#include "bdcreate.h"
#include "cache.h"
#include "channelinfo.h"
+#include "convert.h"
#include "cplayback.h"
#include "cropvideo.h"
#include "cwindow.h"
#include "dvdcreate.h"
#include "edl.h"
#include "edlsession.h"
+#include "exportedl.h"
#include "file.h"
#include "filesystem.h"
#include "filexml.h"
#include "transportque.h"
#include "viewmenu.h"
#include "zoombar.h"
-#include "exportedl.h"
+#include "zwindow.h"
+#include "zwindowgui.h"
#include <string.h>
{
this->gui = gui;
this->mwindow = mwindow;
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("Program Window");
}
MainMenu::~MainMenu()
filemenu->add_item(saveas = new SaveAs(mwindow));
save->create_objects(saveas);
saveas->set_mainmenu(this);
- SaveProject *save_project;
- filemenu->add_item(save_project = new SaveProject(mwindow));
+ filemenu->add_item(new SaveProject(mwindow));
+ filemenu->add_item(new SaveSession(mwindow));
filemenu->add_item(record_menu_item = new RecordMenuItem(mwindow));
#ifdef HAVE_DVB
keyframemenu->add_item(new CopyKeyframes(mwindow));
keyframemenu->add_item(new PasteKeyframes(mwindow));
keyframemenu->add_item(new ClearKeyframes(mwindow));
- keyframemenu->add_item(new StraightenKeyframes(mwindow));
- keyframemenu->add_item(new BendKeyframes(mwindow));
+ keyframemenu->add_item(set_auto_curves = new SetAutomationCurveMode(mwindow));
+ set_auto_curves->create_objects();
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(keyframe_create = new KeyframeCreate(mwindow));
+ keyframe_create->create_objects();
keyframemenu->add_item(new BC_MenuItem("-"));
keyframemenu->add_item(new CopyDefaultKeyframe(mwindow));
keyframemenu->add_item(new PasteDefaultKeyframe(mwindow));
add_menu(trackmenu = new BC_Menu(_("Tracks")));
trackmenu->add_item(new MoveTracksUp(mwindow));
trackmenu->add_item(new MoveTracksDown(mwindow));
+ trackmenu->add_item(new RollTracksUp(mwindow));
+ trackmenu->add_item(new RollTracksDown(mwindow));
trackmenu->add_item(new DeleteTracks(mwindow));
trackmenu->add_item(new DeleteFirstTrack(mwindow));
trackmenu->add_item(new DeleteLastTrack(mwindow));
trackmenu->add_item(new ConcatenateTracks(mwindow));
+ trackmenu->add_item(new AlignTimecodes(mwindow));
AppendTracks *append_tracks;
trackmenu->add_item(append_tracks = new AppendTracks(mwindow));
append_tracks->create_objects();
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();
+ ConvertMenuItem *convert;
+ settingsmenu->add_item(convert = new ConvertMenuItem(mwindow));
+ convert->create_objects();
mwindow->preferences_thread = preferences->thread;
settingsmenu->add_item(cursor_on_frames = new CursorOnFrames(mwindow));
settingsmenu->add_item(labels_follow_edits = new LabelsFollowEdits(mwindow));
// ================================================= edit
-Undo::Undo(MWindow *mwindow) : BC_MenuItem(_("Undo"), "z", 'z')
+Undo::Undo(MWindow *mwindow) : BC_MenuItem(_("Undo"), "z or Ctrl-z", 'z')
{
this->mwindow = mwindow;
}
}
-
-StraightenKeyframes::StraightenKeyframes(MWindow *mwindow)
- : BC_MenuItem(_("Change to linear"))
+SetAutomationCurveItem::SetAutomationCurveItem(SetAutomationCurveMode *set_curve_mode, int id)
+ : BC_MenuItem(FloatAuto::curve_name(id))
{
- this->mwindow = mwindow;
+ this->set_curve_mode = set_curve_mode;
+ this->id = id;
}
-int StraightenKeyframes::handle_event()
+int SetAutomationCurveItem::handle_event()
{
- mwindow->set_automation_mode(FloatAuto::LINEAR);
+ set_curve_mode->mwindow->set_automation_mode((FloatAuto::t_mode)id);
return 1;
}
+SetAutoCurveModeMenu::SetAutoCurveModeMenu(SetAutomationCurveMode *curve_mode)
+: BC_SubMenu()
+{
+ this->curve_mode = curve_mode;
+}
-
-
-BendKeyframes::BendKeyframes(MWindow *mwindow)
- : BC_MenuItem(_("Change to smooth"))
+SetAutomationCurveMode::SetAutomationCurveMode(MWindow *mwindow)
+ : BC_MenuItem(_("Set curve modes..."))
{
this->mwindow = mwindow;
+ curve_mode_menu = 0;
}
-int BendKeyframes::handle_event()
+void SetAutomationCurveMode::create_objects()
{
- mwindow->set_automation_mode(FloatAuto::SMOOTH);
- return 1;
+ add_submenu(curve_mode_menu = new SetAutoCurveModeMenu(this));
+ for( int id=FloatAuto::SMOOTH; id<=FloatAuto::BUMP; ++id )
+ curve_mode_menu->add_item(new SetAutomationCurveItem(this, id));
}
-
KeyframeCurveType::KeyframeCurveType(MWindow *mwindow)
: BC_MenuItem(_("Create curve type..."))
{
void KeyframeCurveType::create_objects()
{
add_submenu(curve_menu = new KeyframeCurveTypeMenu(this));
- for( int i=FloatAuto::SMOOTH; i<=FloatAuto::FREE; ++i ) {
+ for( int i=FloatAuto::SMOOTH; i<=FloatAuto::BUMP; ++i ) {
KeyframeCurveTypeItem *curve_type_item = new KeyframeCurveTypeItem(i, this);
curve_menu->add_submenuitem(curve_type_item);
}
}
+KeyframeCreateItem::KeyframeCreateItem(KeyframeCreate *keyframe_create,
+ const char *text, int mask)
+ : BC_MenuItem(text)
+{
+ this->keyframe_create = keyframe_create;
+ this->mask = mask;
+}
+
+int KeyframeCreateItem::handle_event()
+{
+ MWindow *mwindow = keyframe_create->mwindow;
+ int mode = mwindow->edl->local_session->floatauto_type;
+ int mask = this->mask;
+ if( !mask ) { // visible
+ int *autos = mwindow->edl->session->auto_conf->autos;
+ int modes = (1<<AUTOMATION_FADE) + (1<<AUTOMATION_SPEED) +
+ (7<<AUTOMATION_CAMERA_X) + (7<<AUTOMATION_PROJECTOR_X);
+ for( int i=0; i<AUTOMATION_TOTAL; modes>>=1, ++i ) {
+ if( !(modes & 1) ) continue;
+ if( autos[i] ) mask |= (1<<i);
+ }
+ }
+ mwindow->create_keyframes(mask, mode);
+ return 1;
+}
+
+KeyframeCreateMenu::KeyframeCreateMenu(KeyframeCreate *keyframe_create)
+: BC_SubMenu()
+{
+ this->keyframe_create = keyframe_create;
+}
+
+KeyframeCreate::KeyframeCreate(MWindow *mwindow)
+ : BC_MenuItem(_("Create keyframes..."))
+{
+ this->mwindow = mwindow;
+ keyframe_create_menu = 0;
+}
+
+void KeyframeCreate::create_objects()
+{
+ add_submenu(keyframe_create_menu = new KeyframeCreateMenu(this));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Visible"), 0));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Fade"),
+ (1<<AUTOMATION_FADE)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Speed"),
+ (1<<AUTOMATION_SPEED)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Camera XYZ"),
+ (7<<AUTOMATION_CAMERA_X)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Projector XYZ"),
+ (7<<AUTOMATION_PROJECTOR_X)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Fade+Speed+XYZ"),
+ (1<<AUTOMATION_FADE) + (1<<AUTOMATION_SPEED) +
+ (7<<AUTOMATION_CAMERA_X) + (7<<AUTOMATION_PROJECTOR_X)));
+}
+
+
CutDefaultKeyframe::CutDefaultKeyframe(MWindow *mwindow)
: BC_MenuItem(_("Cut default keyframe"), _("Alt-x"), 'x')
{
int Clear::handle_event()
{
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 AddVideoTrack::handle_event()
{
if( mwindow->session->current_operation == NO_OPERATION )
- mwindow->add_video_track_entry();
+ mwindow->add_video_track_entry(1, 0);
return 1;
}
}
DeleteLastTrack::DeleteLastTrack(MWindow *mwindow)
- : BC_MenuItem(_("Delete last track"), "d", 'd')
+ : BC_MenuItem(_("Delete last track"), "Ctrl-d", 'd')
{
+ set_ctrl(1);
this->mwindow = mwindow;
}
MoveTracksDown::MoveTracksDown(MWindow *mwindow)
: BC_MenuItem(_("Move tracks down"), _("Shift-Down"), DOWN)
{
- set_shift(); this->mwindow = mwindow;
+ this->mwindow = mwindow;
+ set_shift();
}
int MoveTracksDown::handle_event()
}
+RollTracksUp::RollTracksUp(MWindow *mwindow)
+ : BC_MenuItem(_("Roll tracks up"), _("Ctrl-Shift-Up"), UP)
+{
+ this->mwindow = mwindow;
+ set_ctrl();
+ set_shift();
+}
+
+int RollTracksUp::handle_event()
+{
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->roll_tracks_up();
+ return 1;
+}
+
+RollTracksDown::RollTracksDown(MWindow *mwindow)
+ : BC_MenuItem(_("Roll tracks down"), _("Ctrl-Shift-Down"), DOWN)
+{
+ this->mwindow = mwindow;
+ set_ctrl();
+ set_shift();
+}
+
+int RollTracksDown::handle_event()
+{
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->roll_tracks_down();
+ return 1;
+}
+
+
ConcatenateTracks::ConcatenateTracks(MWindow *mwindow)
int AddSubttlTrack::handle_event()
{
if( mwindow->session->current_operation == NO_OPERATION )
- mwindow->add_subttl_track_entry();
+ mwindow->add_subttl_track_entry(1, 0);
return 1;
}
}
SaveSettingsNow::SaveSettingsNow(MWindow *mwindow)
- : BC_MenuItem(_("Save settings now"),_("Ctrl-s"),'s')
+ : BC_MenuItem(_("Save settings now"),_("Ctrl-Shift-S"),'S')
{
this->mwindow = mwindow;
set_ctrl(1);
+ set_shift(1);
}
int SaveSettingsNow::handle_event()
}
int ShowVWindow::handle_event()
{
- mwindow->show_vwindow();
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ mwindow->gui->unlock_window();
+ if( !mwindow->session->show_vwindow )
+ mwindow->show_vwindow(1);
+ else
+ mwindow->hide_vwindow(1);
+ mwindow->gui->lock_window("ShowVWindow::handle_event");
+ set_checked(mwindow->session->show_vwindow);
+ }
return 1;
}
}
int ShowAWindow::handle_event()
{
- mwindow->show_awindow();
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ mwindow->gui->unlock_window();
+ if( !mwindow->session->show_awindow )
+ mwindow->show_awindow();
+ else
+ mwindow->hide_awindow();
+ mwindow->gui->lock_window("ShowAWindow::handle_event");
+ set_checked(mwindow->session->show_awindow);
+
+ }
return 1;
}
}
int ShowCWindow::handle_event()
{
- mwindow->show_cwindow();
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+ mwindow->gui->unlock_window();
+ if( !mwindow->session->show_cwindow )
+ mwindow->show_cwindow();
+ else
+ mwindow->hide_cwindow();
+ mwindow->gui->lock_window("ShowCWindow::handle_event");
+ set_checked(mwindow->session->show_cwindow);
+ }
return 1;
}
int ShowGWindow::handle_event()
{
if( mwindow->session->current_operation == NO_OPERATION ) {
+ mwindow->gui->unlock_window();
if( !mwindow->session->show_gwindow )
mwindow->show_gwindow();
else
mwindow->hide_gwindow();
+ mwindow->gui->lock_window("ShowGWindow::handle_event");
set_checked(mwindow->session->show_gwindow);
}
return 1;
}
int ShowLWindow::handle_event()
{
- mwindow->show_lwindow();
+ if( mwindow->session->current_operation == NO_OPERATION ) {
+
+ mwindow->gui->unlock_window();
+ if( !mwindow->session->show_lwindow )
+ mwindow->show_lwindow();
+ else
+ mwindow->hide_lwindow();
+ mwindow->gui->lock_window("ShowLWindow::handle_event");
+ set_checked(mwindow->session->show_lwindow);
+ }
return 1;
}
{
BC_SubMenu *mixer_submenu = new BC_SubMenu();
add_submenu(mixer_submenu);
- mixer_submenu->add_submenuitem(new MixerViewer(mwindow));
- mixer_submenu->add_submenuitem(new TileMixers(mwindow));
- mixer_submenu->add_submenuitem(new AlignMixers(mwindow));
+ mixer_submenu->add_submenuitem(new MixerViewer(this));
+ mixer_submenu->add_submenuitem(new DragTileMixers(this));
+ mixer_submenu->add_submenuitem(new AlignMixers(this));
+ mixer_submenu->add_submenuitem(new MixMasters(this));
}
-MixerViewer::MixerViewer(MWindow *mwindow)
- : BC_MenuItem(_("Mixer Viewer"), _("Shift-M"), 'M')
+int MixerItems::activate_submenu()
+{
+ BC_SubMenu *mixer_submenu = (BC_SubMenu *)get_submenu();
+ int k = mixer_submenu->total_items();
+ while( --k >= 0 ) {
+ MixerItem *mixer_item = (MixerItem *)mixer_submenu->get_item(k);
+ if( mixer_item->idx < 0 ) continue;
+ mixer_submenu->del_item(mixer_item);
+ }
+ int n = mwindow->edl->mixers.size();
+ for( int i=0; i<n; ++i ) {
+ Mixer *mixer = mwindow->edl->mixers[i];
+ if( !mixer ) continue;
+ MixerItem *mixer_item = new MixerItem(this, mixer->title, mixer->idx);
+ mixer_submenu->add_submenuitem(mixer_item);
+ }
+ return BC_MenuItem::activate_submenu();
+}
+
+MixerItem::MixerItem(MixerItems *mixer_items, const char *text, int idx)
+ : BC_MenuItem(text)
+{
+ this->mixer_items = mixer_items;
+ this->idx = idx;
+}
+
+MixerItem::MixerItem(MixerItems *mixer_items, const char *text, const char *hotkey_text, int hotkey)
+ : BC_MenuItem(text, hotkey_text, hotkey)
+{
+ this->mixer_items = mixer_items;
+ this->idx = -1;
+}
+
+int MixerItem::handle_event()
+{
+ if( idx < 0 ) return 0;
+ MWindow *mwindow = mixer_items->mwindow;
+ Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
+ if( !mixer ) return 0;
+ ZWindow *zwindow = mwindow->get_mixer(idx);
+ if( !zwindow )
+ zwindow = mwindow->get_mixer(mixer);
+ if( !zwindow->zgui ) {
+ zwindow->set_title(mixer->title);
+ zwindow->start();
+ }
+ zwindow->zgui->lock_window("MixerItem::handle_event");
+ zwindow->zgui->raise_window();
+ zwindow->zgui->unlock_window();
+ mwindow->refresh_mixers();
+ return 1;
+}
+
+MixerViewer::MixerViewer(MixerItems *mixer_items)
+ : MixerItem(mixer_items, _("Mixer Viewer"), _("Shift-M"), 'M')
{
- this->mwindow = mwindow;
set_shift(1);
}
int MixerViewer::handle_event()
{
+ MWindow *mwindow = mixer_items->mwindow;
mwindow->start_mixer();
return 1;
}
-TileMixers::TileMixers(MWindow *mwindow)
- : BC_MenuItem(_("Tile mixers"), "Alt-t", 't')
+DragTileMixers::DragTileMixers(MixerItems *mixer_items)
+ : MixerItem(mixer_items, _("Drag Tile mixers"), "Alt-t", 't')
{
- this->mwindow = mwindow;
set_alt();
+ drag_box = 0;
}
-int TileMixers::handle_event()
+DragTileMixers::~DragTileMixers()
{
- mwindow->tile_mixers();
+ delete drag_box;
+}
+
+int DragTileMixers::handle_event()
+{
+ if( !drag_box ) {
+ MWindow *mwindow = mixer_items->mwindow;
+ drag_box = new TileMixersDragBox(mwindow->gui);
+ }
+ if( !drag_box->running() )
+ drag_box->start(this);
return 1;
}
-AlignMixers::AlignMixers(MWindow *mwindow)
- : BC_MenuItem(_("Align mixers"))
+TileMixersDragBox::TileMixersDragBox(MWindowGUI *gui)
+ : BC_DragBox(gui)
+{
+ tile_mixers = 0;
+}
+
+void TileMixersDragBox::start(DragTileMixers *tile_mixers)
+{
+ this->tile_mixers = tile_mixers;
+ start_drag();
+}
+
+int TileMixersDragBox::handle_done_event(int x0, int y0, int x1, int y1)
+{
+ MWindow *mwindow = tile_mixers->mixer_items->mwindow;
+ if( x0 >= x1 || y0 >= y1 ) x0 = x1 = y0 = y1 = 0;
+ mwindow->session->tile_mixers_x = x0;
+ mwindow->session->tile_mixers_y = y0;
+ mwindow->session->tile_mixers_w = x1 - x0;
+ mwindow->session->tile_mixers_h = y1 - y0;
+ mwindow->tile_mixers(x0, y0, x1, y1);
+ tile_mixers = 0;
+ return 1;
+}
+
+AlignMixers::AlignMixers(MixerItems *mixer_items)
+ : MixerItem(mixer_items, _("Align mixers"), "", 0)
{
- this->mwindow = mwindow;
}
int AlignMixers::handle_event()
{
+ MWindow *mwindow = mixer_items->mwindow;
int wx, wy;
mwindow->gui->get_abs_cursor(wx, wy);
mwindow->mixers_align->start_dialog(wx, wy);
return 1;
}
+MixMasters::MixMasters(MixerItems *mixer_items)
+ : MixerItem(mixer_items, _("Mix masters"), "", 0)
+{
+}
+
+int MixMasters::handle_event()
+{
+ MWindow *mwindow = mixer_items->mwindow;
+ mwindow->mix_masters();
+ return 1;
+}
+
+
+AlignTimecodes::AlignTimecodes(MWindow *mwindow)
+ : BC_MenuItem(_("Align Timecodes"))
+{
+ this->mwindow = mwindow;
+}
+
+int AlignTimecodes::handle_event()
+{
+ mwindow->align_timecodes();
+ return 1;
+}
+
LoadLayoutItem::LoadLayoutItem(LoadLayout *load_layout, const char *text, int idx, int hotkey)
: BC_MenuItem(text, "", hotkey)
}
LoadLayoutConfirm::LoadLayoutConfirm(LoadLayoutDialog *layout_dialog, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Layout"), x, y, 300,140, 300,140, 0)
+ : BC_Window(_(PROGRAM_NAME ": Layout"), x, y, xS(300),yS(140), xS(300),yS(140), 0)
{
this->layout_dialog = layout_dialog;
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("Window Layouts");
}
LoadLayoutConfirm::~LoadLayoutConfirm()
void LoadLayoutConfirm::create_objects()
{
+ int xs10 = xS(10), xs20 = xS(20);
+ int ys10 = yS(10);
lock_window("LoadLayoutConfirm::create_objects");
- int x = 10, y = 10, pad = 10;
+ int x = xs10, y = ys10;
BC_SubMenu *layout_submenu = layout_dialog->load_layout->get_submenu();
LoadLayoutItem *item = (LoadLayoutItem *)
layout_submenu->get_item(layout_dialog->idx);
BC_Title *title;
add_subwindow(title = new BC_Title(x, y, _("Layout Name:")));
- int x1 = x + title->get_w() + 10;
+ int x1 = x + title->get_w() + xs10;
add_subwindow(title = new BC_Title(x1, y, item->get_text()));
- y += title->get_h() + pad;
+ y += title->get_h() + ys10;
add_subwindow(name_text = new LoadLayoutNameText(this,
- x, y, get_w()-x-20, item->layout_text));
+ x, y, get_w()-x-xs20, item->layout_text));
y += name_text->get_h();
- x1 = x + 80;
+ x1 = x + xS(80);
char legend[BCTEXTLEN];
sprintf(legend, _("a-z,A-Z,0-9_ only, %dch max"), LAYOUT_NAME_LEN);
add_subwindow(title = new BC_Title(x1, y, legend));