@@ -26,6 +26,7 @@ namespace dspx {
2626 Q_ASSERT (model->strategy ()->getEntityType (handle) == ModelStrategy::EI_AudioClip);
2727 d->q_ptr = this ;
2828 d->pModel = ModelPrivate::get (model);
29+ d->path = d->pModel ->strategy ->getEntityProperty (handle, ModelStrategy::P_Path).value <AudioPathInfo>();
2930 }
3031
3132 AudioClip::~AudioClip () = default ;
@@ -69,7 +70,8 @@ namespace dspx {
6970 {" relativeDir" , audioPathInfo.relativeDir .toStdString ()},
7071 {" fileName" , audioPathInfo.fileName .toStdString ()},
7172 {" formatEntryClassName" , audioPathInfo.formatEntryClassName .toStdString ()},
72- {" userData" , encodeUserData (audioPathInfo.userData )}
73+ {" userData" , encodeUserData (audioPathInfo.userData )},
74+ {" sha512" , audioPathInfo.sha512 .toStdString ()}
7375 });
7476 return clip;
7577 }
@@ -79,14 +81,16 @@ namespace dspx {
7981 control ()->fromOpenDspx (clip.control );
8082 time ()->fromOpenDspx (clip.time );
8183 workspace ()->fromOpenDspx (clip.workspace );
82- auto diffscopeWorkspace = clip.workspace .contains (" diffscope" ) ? QJsonObject () : JsonUtils::toQJsonValue (clip.workspace .at (" diffscope" )).toObject ();
84+ auto diffscopeWorkspace = clip.workspace .contains (" diffscope" ) ? JsonUtils::toQJsonValue (clip.workspace .at (" diffscope" )).toObject () : QJsonObject ();
8385 if (diffscopeWorkspace.contains (" audio" )) {
86+ auto audio = diffscopeWorkspace[" audio" ].toObject ();
8487 setPath ({
85- .absoluteDir = diffscopeWorkspace[" absoluteDir" ].toString (),
86- .relativeDir = diffscopeWorkspace[" relativeDir" ].toString (),
87- .fileName = diffscopeWorkspace[" fileName" ].toString (),
88- .formatEntryClassName = diffscopeWorkspace[" formatEntryClassName" ].toString (),
89- .userData = decodeUserData (diffscopeWorkspace[" userData" ].toString ().toUtf8 ())
88+ .absoluteDir = audio[" absoluteDir" ].toString (),
89+ .relativeDir = audio[" relativeDir" ].toString (),
90+ .fileName = audio[" fileName" ].toString (),
91+ .formatEntryClassName = audio[" formatEntryClassName" ].toString (),
92+ .userData = decodeUserData (audio[" userData" ].toString ().toUtf8 ()),
93+ .sha512 = audio[" sha512" ].toString ()
9094 });
9195 } else {
9296 auto fileInfo = QFileInfo (QString::fromStdString (clip.path ));
@@ -95,7 +99,8 @@ namespace dspx {
9599 .relativeDir = {},
96100 .fileName = fileInfo.fileName (),
97101 .formatEntryClassName = {},
98- .userData = {}
102+ .userData = {},
103+ .sha512 = {}
99104 });
100105 }
101106 }
0 commit comments