ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
[blender.git] / source / blender / editors / sound / sound_ops.c
index ffb1898d8161b4850f2fcceb08ea5f04fe39fa1a..4931426d62e0e1150beba064483e59690df22942 100644 (file)
@@ -116,7 +116,7 @@ static int sound_open_exec(bContext *C, wmOperator *op)
        info = AUD_getInfo(sound->playback_handle);
 
        if (info.specs.channels == AUD_CHANNELS_INVALID) {
-               BKE_sound_delete(bmain, sound);
+               BKE_libblock_free(bmain, sound);
                if (op->customdata) MEM_freeN(op->customdata);
                BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
                return OPERATOR_CANCELLED;
@@ -185,10 +185,11 @@ static void SOUND_OT_open(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* properties */
-       WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_SOUND | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE,
-                                      WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
+       WM_operator_properties_filesel(
+               ot, FILE_TYPE_FOLDER | FILE_TYPE_SOUND | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE,
+               WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
        RNA_def_boolean(ot->srna, "cache", false, "Cache", "Cache the sound in memory");
-       RNA_def_boolean(ot->srna, "mono", false, "Mono", "Mixdown the sound to mono");
+       RNA_def_boolean(ot->srna, "mono", false, "Mono", "Merge all the sound's channels into one");
 }
 
 static void SOUND_OT_open_mono(wmOperatorType *ot)
@@ -207,8 +208,9 @@ static void SOUND_OT_open_mono(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* properties */
-       WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_SOUND | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE,
-                                      WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
+       WM_operator_properties_filesel(
+               ot, FILE_TYPE_FOLDER | FILE_TYPE_SOUND | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE,
+               WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
        RNA_def_boolean(ot->srna, "cache", false, "Cache", "Cache the sound in memory");
        RNA_def_boolean(ot->srna, "mono", true, "Mono", "Mixdown the sound to mono");
 }
@@ -652,10 +654,13 @@ static void SOUND_OT_mixdown(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER;
 
        /* properties */
-       WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_SOUND, FILE_SPECIAL, FILE_SAVE,
-                                      WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
+       WM_operator_properties_filesel(
+               ot, FILE_TYPE_FOLDER | FILE_TYPE_SOUND, FILE_SPECIAL, FILE_SAVE,
+               WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
 #ifdef WITH_AUDASPACE
-       RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy, important for animation data (the lower the value, the more accurate)", 1, 16777216);
+       RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy",
+                   "Sample accuracy, important for animation data (the lower the value, the more accurate)",
+                   1, 16777216);
        RNA_def_enum(ot->srna, "container", container_items, AUD_CONTAINER_FLAC, "Container", "File format");
        RNA_def_enum(ot->srna, "codec", codec_items, AUD_CODEC_FLAC, "Codec", "Audio Codec");
        RNA_def_enum(ot->srna, "format", format_items, AUD_FORMAT_S16, "Format", "Sample format");
@@ -778,7 +783,7 @@ static void SOUND_OT_unpack(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* properties */
-       RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
+       RNA_def_enum(ot->srna, "method", rna_enum_unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
        RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Sound Name", "Sound datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */
 }