Skip to content

Commit

Permalink
Fixed language cancel.
Browse files Browse the repository at this point in the history
Allowed saving a sequence with no audio and then a movie with audio.
  • Loading branch information
ggarra13 committed Sep 2, 2024
1 parent 215723f commit 5ed2eb3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ v1.2.6
- Allowed saving .otio movie files as .mp4, .mov, etc. files. This allows
turning an .otio file into a new movie file. Useful when concatenating
movies with the Playlist panel or the -edl command-line switch.
- Fixed cancelling of language switch.
- Added showing name of language that will be changed to.


v1.2.5
Expand Down
15 changes: 10 additions & 5 deletions src/lib/mrvFl/mrvLanguages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ void check_language(PreferencesUI* uiPrefs, int& language_index, mrv::App* app)
int uiIndex = uiPrefs->uiLanguage->value();
if (uiIndex != language_index)
{
int ok = fl_choice(
_("Need to reboot mrv2 to change language. "
"Are you sure you want to continue?"),
_("No"), _("Yes"), NULL, NULL);
const char* language = _(kLanguages[uiIndex].name);

std::string question =
tl::string::Format(
_("Need to reboot mrv2 to change language to {0}. "
"Are you sure you want to continue?"))
.arg(language);

int ok = fl_choice(question.c_str(), _("No"), _("Yes"), NULL, NULL);
if (ok)
{
language_index = uiIndex;
Expand Down Expand Up @@ -102,7 +107,7 @@ void check_language(PreferencesUI* uiPrefs, int& language_index, mrv::App* app)
}
else
{
uiPrefs->uiLanguage->value(uiIndex);
uiPrefs->uiLanguage->value(language_index);
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion src/lib/mrvFl/mrvSaveMovie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,13 @@ namespace mrv
otime::RationalTime(
currentTime.rate(), currentTime.rate()));
auto audio = audioData.layers[0].audio;
if (!audio)
{
// Create silence
audio = audio::Audio::create(info.audio,
sampleRate);
audio->zero();
}

// \todo mix audio layers (or have a function in
// timeline to do it).
Expand All @@ -698,7 +705,8 @@ namespace mrv

// timeline->getAudio() returns one second of audio.
// Clamp to end of the timeRange/inOutRange.
if (currentAudioTime.value() >= currentSampleCount)
if (!skip &&
currentAudioTime.value() >= currentSampleCount)
{
const size_t sampleCount = audio->getSampleCount();
if (currentSampleCount + sampleCount >=
Expand Down
11 changes: 6 additions & 5 deletions src/lib/mrvWidgets/mrvPreferencesUI.fl
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ class PreferencesUI {open
} {
Fl_Window uiMain {
label Preferences
user_data this user_data_type {PreferencesUI*} open
user_data this user_data_type {PreferencesUI*}
callback {o->hide();} open selected
xywh {903 93 853 467} type Double resizable
code0 {main = m;} visible
} {
Fl_Group {} {open
xywh {0 0 853 466} box FLAT_BOX
} {
Fl_Group {} {open selected
Fl_Group {} {open
xywh {283 28 570 428}
} {
Fl_Wizard uiWizard {
Expand All @@ -103,7 +104,7 @@ class PreferencesUI {open
} {
Fl_Group {} {
label {User Interface}
xywh {288 37 555 360} box EMBOSSED_BOX align 5
xywh {288 37 555 360} box EMBOSSED_BOX align 5 hide
} {
Fl_Group {} {
label {Window Behavior}
Expand Down Expand Up @@ -1246,7 +1247,7 @@ v->uiOCIO_Display_View->do_callback();}
}
Fl_Group {} {
label Loading
xywh {288 37 555 360} align 5 hide
xywh {288 37 555 360} align 5
} {
Fl_Group {} {open
xywh {324 140 488 180}
Expand Down Expand Up @@ -1628,7 +1629,7 @@ v->uiOCIO_Display_View->do_callback();}
}
}
}
Fl_Group {} {
Fl_Group {} {open
xywh {320 412 470 44}
} {
Fl_Button {} {
Expand Down

0 comments on commit 5ed2eb3

Please sign in to comment.