-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation of MTC #6164
base: master
Are you sure you want to change the base?
Conversation
Code-wise, I'm not sure if this code wants to be part of the Time toolbar, maybe it should be its own little |
Thanks for the response. I agree with you. Just explaining more about why I did this way, but I agree with you:
Thanks!!! |
We could structure the menu similar to the snapping options right next-door and put things into submenus instead: This design assumes you still want your #316 in still, and further assumes that a 30fps timecode would be added. When switching between different formats, the MTC would need to slightly lie (eg sending NTSC drop frames even though non-drop frames are selected) but overall it'd keep things in sync. |
Wow, awesome! Yes, that is an excellent solution. I'll look into that. |
@@ -152,6 +152,7 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) | |||
S.TieCheckBox(XXO("Always scrub un&pinned"), | |||
{UnpinnedScrubbingPreferenceKey(), | |||
UnpinnedScrubbingPreferenceDefault()}); | |||
S.TieCheckBox(XXO("Send MTC (MIDI Time Code)"), {"/AudioIO/SendMTC", true}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make a named BoolSetting object in this MidiIO.cpp, declared in a header, to avoid repetition of the string literal. See other examples. Specify the preference path and default value in just one place.
static_cast<unsigned char>(minutes), static_cast<unsigned char>(seconds), | ||
static_cast<unsigned char>(frames), 0xF7}; | ||
|
||
Pm_WriteSysEx(portMidiStream, 0, message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t like having all this in a toolbar file, whose purpose is UI.
Rather add to MidiIO.cpp and its header file and make calls into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where could it trigger the MTC send function?
bool isPortMidiInitialized = false; | ||
void InitializePortMidi(); | ||
void TerminatePortMidi(); | ||
void UpdatePortMidiAccordingToPreferences(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function isn’t reached when the state of the checkbox is changed in PlaybackPrefs.
You could call it from the Commit method of the preference page.
Again, move the functions that do all the real business to a file whose job is not GUI. Neither the toolbar nor preference page should depend on the other.
Resolves: #6159, #5418, #37, #2167, #1023, helps #5038
This enables Audacity to send MTC through PortMidi. Of course, I'm not sure if the TimeToolBar is the best place to put it, but for the user perspective, it make sense that it would be "sent" by the time toolbar. This adds a checkbox on a context menu and also adds an option on Playback panel on Preferences. We would need to find a way to expose the video framerate selection for the user, though. Another thing to consider is that it's selecting the "Default" device to send. Maybe we should expose an option for the user to choose..?
To test, open the audio of a video in Audacity and open XJadeo. In XJadeo, select the Sync mode to MTC (Portmidi) and enable the option on Audacity. If video is not sinchronized, that's probably because the video framerate is hardcoded to 29.97. Launching XJadeo with the option "-M 1" should work around this.
Of couse, PLEASE, give me feedback on the code as I'm a Python developer, not C++. Thanks!!
Recommended: