#include "patchbay.h"
#include "playbackengine.h"
#include "preferences.h"
+#include "proxy.h"
#include "preferencesthread.h"
#include "quit.h"
#include "record.h"
total_loads = 0;
add_menu(filemenu = new BC_Menu(_("File")));
- filemenu->add_item(new_project = new New(mwindow));
+ filemenu->add_item(new_project = new NewProject(mwindow));
new_project->create_objects();
// file loaders
save->create_objects(saveas);
saveas->set_mainmenu(this);
filemenu->add_item(record_menu_item = new RecordMenuItem(mwindow));
+#ifdef HAVE_DVB
filemenu->add_item(new ChannelScan(mwindow));
+#endif
if( mwindow->has_commercials() )
filemenu->add_item(new DbWindowScan(mwindow));
filemenu->add_item(new SubttlSWin(mwindow));
keyframemenu->add_item(new ClearKeyframes(mwindow));
keyframemenu->add_item(new StraightenKeyframes(mwindow));
keyframemenu->add_item(new BendKeyframes(mwindow));
- keyframemenu->add_item(keyframe_curve_type =
- new KeyframeCurveType(mwindow,
- mwindow->edl->local_session->floatauto_type));
+ keyframemenu->add_item(keyframe_curve_type = new KeyframeCurveType(mwindow));
keyframe_curve_type->create_objects();
+ keyframe_curve_type->update(mwindow->edl->local_session->floatauto_type);
keyframemenu->add_item(new BC_MenuItem("-"));
keyframemenu->add_item(new CopyDefaultKeyframe(mwindow));
keyframemenu->add_item(new PasteDefaultKeyframe(mwindow));
trackmenu->add_item(new DeleteTracks(mwindow));
trackmenu->add_item(new DeleteTrack(mwindow));
trackmenu->add_item(new ConcatenateTracks(mwindow));
+ AppendTracks *append_tracks;
+ trackmenu->add_item(append_tracks = new AppendTracks(mwindow));
+ append_tracks->create_objects();
trackmenu->add_item(new AddSubttlTrack(mwindow));
add_menu(settingsmenu = new BC_Menu(_("Settings")));
settingsmenu->add_item(new SetFormat(mwindow));
settingsmenu->add_item(preferences = new PreferencesMenuitem(mwindow));
+ ProxyMenuItem *proxy;
+ settingsmenu->add_item(proxy = new ProxyMenuItem(mwindow));
+ proxy->create_objects();
mwindow->preferences_thread = preferences->thread;
settingsmenu->add_item(labels_follow_edits = new LabelsFollowEdits(mwindow));
settingsmenu->add_item(plugins_follow_edits = new PluginsFollowEdits(mwindow));
settingsmenu->add_item(new BC_MenuItem("-"));
settingsmenu->add_item(new SaveSettingsNow(mwindow));
settingsmenu->add_item(loop_playback = new LoopPlayback(mwindow));
- settingsmenu->add_item(new SetBRenderStart(mwindow));
+ settingsmenu->add_item(brender_active = new SetBRenderActive(mwindow));
// set scrubbing speed
// ScrubSpeed *scrub_speed;
// settingsmenu->add_item(scrub_speed = new ScrubSpeed(mwindow));
windowmenu->add_item(new BC_MenuItem("-"));
windowmenu->add_item(split_x = new SplitX(mwindow));
windowmenu->add_item(split_y = new SplitY(mwindow));
+ windowmenu->add_item(mixer_viewer = new MixerViewer(mwindow));
+ windowmenu->add_item(new TileMixers(mwindow));
windowmenu->add_item(new TileWindows(mwindow,_("Default positions"),-1,_("Ctrl-P"),'p'));
windowmenu->add_item(new TileWindows(mwindow,_("Tile left"),0));
windowmenu->add_item(new TileWindows(mwindow,_("Tile right"),1));
}
int Undo::handle_event()
{
- mwindow->undo_entry(mwindow->gui);
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->undo_entry(mwindow->gui);
return 1;
}
int Undo::update_caption(const char *new_caption)
int Redo::handle_event()
{
- mwindow->redo_entry(mwindow->gui);
-
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->redo_entry(mwindow->gui);
return 1;
}
int Redo::update_caption(const char *new_caption)
int CutKeyframes::handle_event()
{
- mwindow->cut_automation();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->cut_automation();
return 1;
}
int CopyKeyframes::handle_event()
{
- mwindow->copy_automation();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->copy_automation();
return 1;
}
int PasteKeyframes::handle_event()
{
- mwindow->paste_automation();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->paste_automation();
return 1;
}
int ClearKeyframes::handle_event()
{
- mwindow->clear_automation();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->clear_automation();
return 1;
}
-KeyframeCurveType::KeyframeCurveType(MWindow *mwindow, int curve_type)
+KeyframeCurveType::KeyframeCurveType(MWindow *mwindow)
: BC_MenuItem(_("Create curve type..."))
{
this->mwindow = mwindow;
- this->curve_type = curve_type;
this->curve_menu = 0;
}
KeyframeCurveType::~KeyframeCurveType()
void KeyframeCurveType::create_objects()
{
- curve_menu = new KeyframeCurveTypeMenu(this);
- mwindow->gui->add_subwindow(curve_menu);
+ add_submenu(curve_menu = new KeyframeCurveTypeMenu(this));
for( int i=FloatAuto::SMOOTH; i<=FloatAuto::FREE; ++i ) {
- curve_menu->add_item(new KeyframeCurveTypeItem(i));
+ KeyframeCurveTypeItem *curve_type_item = new KeyframeCurveTypeItem(i, this);
+ curve_menu->add_submenuitem(curve_type_item);
}
}
-int KeyframeCurveType::handle_event()
+void KeyframeCurveType::update(int curve_type)
{
for( int i=0; i<curve_menu->total_items(); ++i ) {
- KeyframeCurveTypeItem *curve_type_item =
- (KeyframeCurveTypeItem *)curve_menu->get_item(i);
+ KeyframeCurveTypeItem *curve_type_item = (KeyframeCurveTypeItem *)curve_menu->get_item(i);
curve_type_item->set_checked(curve_type_item->type == curve_type);
}
- curve_menu->activate_menu();
+}
+
+int KeyframeCurveType::handle_event()
+{
return 1;
}
KeyframeCurveTypeMenu::KeyframeCurveTypeMenu(KeyframeCurveType *menu_item)
- : BC_PopupMenu(0, 0, 0, "", 0)
+ : BC_SubMenu()
{
this->menu_item = menu_item;
}
{
}
-KeyframeCurveTypeItem::KeyframeCurveTypeItem(int type)
+KeyframeCurveTypeItem::KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item)
: BC_MenuItem(FloatAuto::curve_name(type))
{
this->type = type;
+ this->main_item = main_item;
}
KeyframeCurveTypeItem::~KeyframeCurveTypeItem()
{
int KeyframeCurveTypeItem::handle_event()
{
- KeyframeCurveType *menu_item = ((KeyframeCurveTypeMenu *)get_popup_menu())->menu_item;
- menu_item->curve_type = type;
- menu_item->mwindow->set_keyframe_type(type);
+ main_item->update(type);
+ main_item->mwindow->set_keyframe_type(type);
return 1;
}
int CutDefaultKeyframe::handle_event()
{
- mwindow->cut_default_keyframe();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->cut_default_keyframe();
return 1;
}
int CopyDefaultKeyframe::handle_event()
{
- mwindow->copy_default_keyframe();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->copy_default_keyframe();
return 1;
}
int PasteDefaultKeyframe::handle_event()
{
- mwindow->paste_default_keyframe();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->paste_default_keyframe();
return 1;
}
ClearDefaultKeyframe::ClearDefaultKeyframe(MWindow *mwindow)
- : BC_MenuItem(_("Clear default keyframe"), _("Alt-Del"), BACKSPACE)
+ : BC_MenuItem(_("Clear default keyframe"), _("Alt-Del"), DELETE)
{
set_alt();
this->mwindow = mwindow;
int ClearDefaultKeyframe::handle_event()
{
- mwindow->clear_default_keyframe();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->clear_default_keyframe();
return 1;
}
Cut::Cut(MWindow *mwindow)
- : BC_MenuItem(_("Cut"), "x", 'x')
+ : BC_MenuItem(_("Split | Cut"), "x", 'x')
{
this->mwindow = mwindow;
}
int Cut::handle_event()
{
- mwindow->cut();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->cut();
return 1;
}
int Copy::handle_event()
{
- mwindow->copy();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->copy();
return 1;
}
int Paste::handle_event()
{
- mwindow->paste();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->paste();
return 1;
}
Clear::Clear(MWindow *mwindow)
- : BC_MenuItem(_("Clear"), _("Del"), BACKSPACE)
+ : BC_MenuItem(_("Clear"), _("Del"), DELETE)
{
this->mwindow = mwindow;
}
int Clear::handle_event()
{
- mwindow->cwindow->gui->lock_window("Clear::handle_event");
- mwindow->clear_entry();
- mwindow->cwindow->gui->unlock_window();
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ mwindow->cwindow->gui->lock_window("Clear::handle_event");
+ mwindow->clear_entry();
+ mwindow->cwindow->gui->unlock_window();
+ }
return 1;
}
int PasteSilence::handle_event()
{
- mwindow->paste_silence();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->paste_silence();
return 1;
}
int SelectAll::handle_event()
{
- mwindow->select_all();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->select_all();
return 1;
}
int MuteSelection::handle_event()
{
- mwindow->mute_selection();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->mute_selection();
return 1;
}
int AddAudioTrack::handle_event()
{
- mwindow->add_audio_track_entry(0, 0);
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->add_audio_track_entry(0, 0);
return 1;
}
int DefaultATransition::handle_event()
{
- mwindow->paste_audio_transition();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->paste_audio_transition();
return 1;
}
int AddVideoTrack::handle_event()
{
- mwindow->add_video_track_entry();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->add_video_track_entry();
return 1;
}
int DefaultVTransition::handle_event()
{
- mwindow->paste_video_transition();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->paste_video_transition();
return 1;
}
int DeleteTrack::handle_event()
{
- mwindow->delete_track();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->delete_track();
return 1;
}
int MoveTracksUp::handle_event()
{
- mwindow->move_tracks_up();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->move_tracks_up();
return 1;
}
int MoveTracksDown::handle_event()
{
- mwindow->move_tracks_down();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->move_tracks_down();
return 1;
}
int LoopPlayback::handle_event()
{
- mwindow->toggle_loop_playback();
- set_checked(mwindow->edl->local_session->loop_playback);
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ mwindow->toggle_loop_playback();
+ set_checked(mwindow->edl->local_session->loop_playback);
+ }
return 1;
}
int AddSubttlTrack::handle_event()
{
- mwindow->add_subttl_track_entry();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->add_subttl_track_entry();
return 1;
}
int PasteSubttl::handle_event()
{
- mwindow->gui->swindow->paste_subttl();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->gui->swindow->paste_subttl();
return 1;
}
-
-
-
-
-SetBRenderStart::SetBRenderStart(MWindow *mwindow)
- : BC_MenuItem(_("Set background render"))
+SetBRenderActive::SetBRenderActive(MWindow *mwindow)
+ : BC_MenuItem(_("Toggle background rendering"),_("Shift-G"),'G')
{
this->mwindow = mwindow;
+ set_shift(1);
}
-int SetBRenderStart::handle_event()
+int SetBRenderActive::handle_event()
{
- mwindow->set_brender_start();
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ int v = mwindow->brender_active ? 0 : 1;
+ set_checked(v);
+ mwindow->set_brender_active(v);
+ }
return 1;
}
-
-
-
-
-
LabelsFollowEdits::LabelsFollowEdits(MWindow *mwindow)
: BC_MenuItem(_("Edit labels"))
{
PluginsFollowEdits::PluginsFollowEdits(MWindow *mwindow)
- : BC_MenuItem(_("Edit effects"))
-{
- this->mwindow = mwindow;
+ : BC_MenuItem(_("Edit effects"))
+{
+ this->mwindow = mwindow;
set_checked(mwindow->edl->session->plugins_follow_edits);
}
int PluginsFollowEdits::handle_event()
{
set_checked(get_checked() ^ 1);
- mwindow->edl->session->plugins_follow_edits = get_checked();
+ mwindow->edl->session->plugins_follow_edits = get_checked();
return 1;
}
KeyframesFollowEdits::KeyframesFollowEdits(MWindow *mwindow)
- : BC_MenuItem(_("Keyframes follow edits"))
-{
- this->mwindow = mwindow;
+ : BC_MenuItem(_("Keyframes follow edits"))
+{
+ this->mwindow = mwindow;
set_checked(mwindow->edl->session->autos_follow_edits);
}
int KeyframesFollowEdits::handle_event()
-{
- mwindow->edl->session->autos_follow_edits ^= 1;
+{
+ mwindow->edl->session->autos_follow_edits ^= 1;
set_checked(!get_checked());
return 1;
}
CursorOnFrames::CursorOnFrames(MWindow *mwindow)
- : BC_MenuItem(_("Align cursor on frames"))
-{
- this->mwindow = mwindow;
+ : BC_MenuItem(_("Align cursor on frames"))
+{
+ this->mwindow = mwindow;
set_checked(mwindow->edl->session->cursor_on_frames);
}
int CursorOnFrames::handle_event()
{
- mwindow->edl->session->cursor_on_frames = !mwindow->edl->session->cursor_on_frames;
+ mwindow->edl->session->cursor_on_frames = !mwindow->edl->session->cursor_on_frames;
set_checked(mwindow->edl->session->cursor_on_frames);
return 1;
}
TypelessKeyframes::TypelessKeyframes(MWindow *mwindow)
- : BC_MenuItem(_("Typeless keyframes"))
-{
- this->mwindow = mwindow;
+ : BC_MenuItem(_("Typeless keyframes"))
+{
+ this->mwindow = mwindow;
set_checked(mwindow->edl->session->typeless_keyframes);
}
int TypelessKeyframes::handle_event()
{
- mwindow->edl->session->typeless_keyframes = !mwindow->edl->session->typeless_keyframes;
+ mwindow->edl->session->typeless_keyframes = !mwindow->edl->session->typeless_keyframes;
set_checked(mwindow->edl->session->typeless_keyframes);
return 1;
}
return 1;
}
-SaveSettingsNow::SaveSettingsNow(MWindow *mwindow) : BC_MenuItem(_("Save settings now"))
-{
- this->mwindow = mwindow;
+SaveSettingsNow::SaveSettingsNow(MWindow *mwindow) : BC_MenuItem(_("Save settings now"))
+{
+ this->mwindow = mwindow;
}
int SaveSettingsNow::handle_event()
ShowGWindow::ShowGWindow(MWindow *mwindow)
- : BC_MenuItem(_("Show Overlays"))
+ : BC_MenuItem(_("Show Overlays"), _("Ctrl-0"), '0')
{
this->mwindow = mwindow;
+ set_ctrl(1);
set_checked(mwindow->session->show_gwindow);
}
int ShowGWindow::handle_event()
{
- mwindow->show_gwindow();
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ if( !mwindow->session->show_gwindow )
+ mwindow->show_gwindow();
+ else
+ mwindow->hide_gwindow();
+ set_checked(mwindow->session->show_gwindow);
+ }
return 1;
}
}
int TileWindows::handle_event()
{
- int window_config = config >= 0 ? config :
- mwindow->session->window_config;
- if( mwindow->tile_windows(window_config) ) {
- mwindow->restart_status = 1;
- mwindow->gui->set_done(0);
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ int window_config = config >= 0 ? config :
+ mwindow->session->window_config;
+ if( mwindow->tile_windows(window_config) ) {
+ mwindow->restart_status = 1;
+ mwindow->gui->set_done(0);
+ }
}
return 1;
}
}
int SplitX::handle_event()
{
- mwindow->split_x();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->split_x();
return 1;
}
}
int SplitY::handle_event()
{
- mwindow->split_y();
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->split_y();
+ return 1;
+}
+
+
+MixerViewer::MixerViewer(MWindow *mwindow)
+ : BC_MenuItem(_("Mixer Viewer"), _("Shift-M"), 'M')
+{
+ this->mwindow = mwindow;
+ set_shift(1);
+}
+
+int MixerViewer::handle_event()
+{
+ mwindow->start_mixer();
return 1;
}
+TileMixers::TileMixers(MWindow *mwindow)
+ : BC_MenuItem(_("Tile mixers"), "Alt-t", 't')
+{
+ this->mwindow = mwindow;
+ set_alt();
+}
+
+int TileMixers::handle_event()
+{
+ mwindow->tile_mixers();
+ return 1;
+}