#include "record.h"
#include "recordgui.h"
#include "renderengine.h"
+#include "remotecontrol.h"
#include "resourcethread.h"
#include "samplescroll.h"
#include "shbtnprefs.h"
#include "transitionpopup.h"
#include "vwindowgui.h"
#include "vwindow.h"
+#include "wintv.h"
+#include "x10tv.h"
#include "zoombar.h"
#define PANE_DRAG_MARGIN MAX(mwindow->theme->pane_w, mwindow->theme->pane_h)
lock_window("MWindowGUI::create_objects");
const int debug = 0;
- resource_thread = new ResourceThread(mwindow, this);
+ resource_thread = new ResourceThread(mwindow);
resource_thread->create_objects();
if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__);
set_icon(mwindow->theme->get_image("mwindow_icon"));
remote_control = new RemoteControl(this);
- cwindow_remote_handler = new CWindowRemoteHandler(remote_control);
- record_remote_handler = new RecordRemoteHandler(remote_control);
+ cwindow_remote_handler = 0;
+ record_remote_handler = 0;
+#ifdef HAVE_X10TV
+// should be first, use if plugged
+ if( !cwindow_remote_handler && mwindow->x10tv ) {
+ cwindow_remote_handler = (RemoteHandler*)
+ new X10TVCWindowHandler(mwindow->x10tv, remote_control);
+ record_remote_handler = (RemoteHandler*)
+ new X10TVRecordHandler(mwindow->x10tv, remote_control);
+ }
+#endif
+#ifdef HAVE_WINTV
+ if( !cwindow_remote_handler && mwindow->wintv ) {
+ cwindow_remote_handler = (RemoteHandler*)
+ new WinTVCWindowHandler(mwindow->wintv, remote_control);
+ record_remote_handler = (RemoteHandler*)
+ new WinTVRecordHandler(mwindow->wintv, remote_control);
+ }
+#endif
mwindow->reset_android_remote();
-
+ if( !cwindow_remote_handler )
+ cwindow_remote_handler = (RemoteHandler*)
+ new CWindowKeyEvHandler(mwindow->gui->remote_control);
+ if( !record_remote_handler )
+ record_remote_handler = (RemoteHandler*)
+ new RecordKeyEvHandler(mwindow->gui->remote_control);
if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__);
int x1 = get_w() - MainShBtns::calculate_w(-1, 0, -1) - xS(5);
//printf("MWindowGUI::resize_event %d\n", __LINE__);
mwindow->session->mwindow_w = w;
mwindow->session->mwindow_h = h;
- int x1 = get_w() - MainShBtns::calculate_w(-1, 0, -1) - xS(5);
+ int x1 = w - MainShBtns::calculate_w(-1, 0, -1) - xS(5);
mainshbtns->reposition_window(x1, -1);
int x2 = x1 - mwindow->theme->stack_button_w - xS(5);
stack_button->reposition_window(x2, stack_button->get_y());
switch( get_keypress() ) {
case 'A':
- if( !ctrl_down() || !shift_down() || alt_down() ) break;
- mwindow->edl->tracks->clear_selected_edits();
- draw_overlays(1);
+ if( !alt_down() ) {
+ if( !ctrl_down() || !shift_down() ) break;
+ mwindow->edl->tracks->clear_selected_edits();
+ draw_overlays(1);
+ result = 1;
+ break;
+ } // fall thru
+ case 'a':
+ if( !alt_down() ) break;
+ stop_transport("MWindowGUI::keypress_event 1");
+ mwindow->nearest_auto_keyframe(shift_down(),
+ !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE);
result = 1;
break;
+
case 'e':
mwindow->toggle_editing_mode();
result = 1;
case 'k': case 'K':
if( alt_down() ) break;
- stop_transport("MWindowGUI::keypress_event 1");
+ stop_transport("MWindowGUI::keypress_event 2");
mwindow->nearest_plugin_keyframe(shift_down(),
!ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE);
result = 1;
if( (this_track = pane[i]->over_patchbay()) != 0 ) break;
}
- if( get_keypress() == TAB ) { // Switch the record button
+ if( get_keypress() == TAB ) { // Switch the armed button
if( this_track )
- this_track->record = !this_track->record ? 1 : 0;
+ this_track->armed = !this_track->armed ? 1 : 0;
}
else {
int total_selected = mwindow->edl->tracks->total_of(Tracks::RECORD);
// all selected if nothing previously selected or
// if this patch was previously the only one selected and armed
int selected = !total_selected || (total_selected == 1 &&
- this_track && this_track->record ) ? 1 : 0;
+ this_track && this_track->armed ) ? 1 : 0;
mwindow->edl->tracks->select_all(Tracks::RECORD, selected);
- if( !selected && this_track ) this_track->record = 1;
+ if( !selected && this_track ) this_track->armed = 1;
}
update(0, NORMAL_DRAW, 0, 0, 1, 0, 1);
if( android_control ) return;
android_control = new AndroidControl(this);
}
+int MWindowGUI::keyev_grab_remote()
+{
+ if( cwindow_remote_handler && cwindow_remote_handler->is_keytv() &&
+ record_remote_handler && record_remote_handler->is_keytv() )
+ return 0;
+ delete cwindow_remote_handler;
+ delete record_remote_handler;
+ cwindow_remote_handler = (RemoteHandler*)
+ new CWindowKeyEvHandler(mwindow->gui->remote_control);
+ record_remote_handler = (RemoteHandler*)
+ new RecordKeyEvHandler(mwindow->gui->remote_control);
+ return 1;
+}
int MWindowGUI::close_event()
{
void MWindowGUI::stop_pane_drag()
{
+ if( !dragging_pane ) return;
dragging_pane = 0;
resource_thread->stop_draw(0);