Fix T38768: New "audio" button in 2.70 release does not 'mixdown' audio
[blender.git] / source / blender / editors / sound / sound_ops.c
index 168693db60baa827e0ccd4b59c1424f858cf3507..1979379032f856f47717eeb600ed20ffd902c573 100644 (file)
@@ -476,12 +476,6 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
                {0, NULL, 0, NULL, NULL}
        };
 
                {0, NULL, 0, NULL, NULL}
        };
 
-       static EnumPropertyItem ac3_format_items[] = {
-               {AUD_FORMAT_S16, "S16", 0, "S16", "16 bit signed"},
-               {AUD_FORMAT_FLOAT32, "F32", 0, "F32", "32 bit floating point"},
-               {0, NULL, 0, NULL, NULL}
-       };
-
 #ifdef WITH_SNDFILE
        static EnumPropertyItem flac_format_items[] = {
                {AUD_FORMAT_S16, "S16", 0, "S16", "16 bit signed"},
 #ifdef WITH_SNDFILE
        static EnumPropertyItem flac_format_items[] = {
                {AUD_FORMAT_S16, "S16", 0, "S16", "16 bit signed"},
@@ -527,10 +521,9 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
 
        switch (container) {
                case AUD_CONTAINER_AC3:
 
        switch (container) {
                case AUD_CONTAINER_AC3:
-                       RNA_def_property_clear_flag(prop_format, PROP_HIDDEN);
-                       RNA_def_property_enum_items(prop_format, ac3_format_items);
                        RNA_def_property_enum_items(prop_codec, all_codec_items);
                        RNA_enum_set(op->ptr, "codec", AUD_CODEC_AC3);
                        RNA_def_property_enum_items(prop_codec, all_codec_items);
                        RNA_enum_set(op->ptr, "codec", AUD_CODEC_AC3);
+                       RNA_enum_set(op->ptr, "format", AUD_FORMAT_FLOAT32);
                        break;
                case AUD_CONTAINER_FLAC:
                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);
                        break;
                case AUD_CONTAINER_FLAC:
                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);
@@ -539,9 +532,8 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
 #ifdef WITH_SNDFILE
                        RNA_def_property_clear_flag(prop_format, PROP_HIDDEN);
                        RNA_def_property_enum_items(prop_format, flac_format_items);
 #ifdef WITH_SNDFILE
                        RNA_def_property_clear_flag(prop_format, PROP_HIDDEN);
                        RNA_def_property_enum_items(prop_format, flac_format_items);
-#else
-                       RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
 #endif
 #endif
+                       RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
                        break;
                case AUD_CONTAINER_MATROSKA:
                        RNA_def_property_clear_flag(prop_codec, PROP_HIDDEN);
                        break;
                case AUD_CONTAINER_MATROSKA:
                        RNA_def_property_clear_flag(prop_codec, PROP_HIDDEN);
@@ -552,8 +544,7 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
                                        RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
                                        break;
                                case AUD_CODEC_AC3:
                                        RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
                                        break;
                                case AUD_CODEC_AC3:
-                                       RNA_def_property_enum_items(prop_format, ac3_format_items);
-                                       RNA_def_property_clear_flag(prop_format, PROP_HIDDEN);
+                                       RNA_enum_set(op->ptr, "format", AUD_FORMAT_FLOAT32);
                                        break;
                                case AUD_CODEC_FLAC:
                                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);
                                        break;
                                case AUD_CODEC_FLAC:
                                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);
@@ -565,6 +556,7 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
                                case AUD_CODEC_MP3:
                                        RNA_def_property_enum_items(prop_format, mp3_format_items);
                                        RNA_def_property_clear_flag(prop_format, PROP_HIDDEN);
                                case AUD_CODEC_MP3:
                                        RNA_def_property_enum_items(prop_format, mp3_format_items);
                                        RNA_def_property_clear_flag(prop_format, PROP_HIDDEN);
+                                       RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
                                        break;
                                case AUD_CODEC_PCM:
                                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);
                                        break;
                                case AUD_CODEC_PCM:
                                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);
@@ -589,11 +581,13 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
                        RNA_def_property_enum_items(prop_format, mp3_format_items);
                        RNA_def_property_enum_items(prop_codec, all_codec_items);
                        RNA_enum_set(op->ptr, "codec", AUD_CODEC_MP3);
                        RNA_def_property_enum_items(prop_format, mp3_format_items);
                        RNA_def_property_enum_items(prop_codec, all_codec_items);
                        RNA_enum_set(op->ptr, "codec", AUD_CODEC_MP3);
+                       RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
                        break;
                case AUD_CONTAINER_OGG:
                        RNA_def_property_clear_flag(prop_codec, PROP_HIDDEN);
                        RNA_def_property_enum_items(prop_codec, ogg_codec_items);
                        RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
                        break;
                case AUD_CONTAINER_OGG:
                        RNA_def_property_clear_flag(prop_codec, PROP_HIDDEN);
                        RNA_def_property_enum_items(prop_codec, ogg_codec_items);
                        RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16);
+                       RNA_enum_set(op->ptr, "codec", AUD_CODEC_VORBIS);
                        break;
                case AUD_CONTAINER_WAV:
                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);
                        break;
                case AUD_CONTAINER_WAV:
                        RNA_def_property_flag(prop_bitrate, PROP_HIDDEN);