mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
more tranzport lowlevel fixes and rebinding
git-svn-id: svn://localhost/trunk/ardour2@488 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
3129b822b0
commit
e22a48723e
18 changed files with 97 additions and 75 deletions
|
|
@ -1735,9 +1735,8 @@ AudioClock::set_mode (Mode m)
|
||||||
started editing the clock and then we switch clock mode.
|
started editing the clock and then we switch clock mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// GTK2FIX might need an equivalent here for drop focus
|
clock_base.grab_focus ();
|
||||||
|
|
||||||
|
|
||||||
if (_mode == m) {
|
if (_mode == m) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,8 +180,6 @@ gnome_canvas_imageframe_init (GnomeCanvasImageFrame *image)
|
||||||
image->height = 0.0;
|
image->height = 0.0;
|
||||||
image->drawwidth = 0.0;
|
image->drawwidth = 0.0;
|
||||||
image->anchor = GTK_ANCHOR_CENTER;
|
image->anchor = GTK_ANCHOR_CENTER;
|
||||||
// GTK2FIX
|
|
||||||
// GNOME_CANVAS_ITEM(image)->object.flags |= GNOME_CANVAS_ITEM_NO_AUTO_REDRAW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -163,9 +163,6 @@ gnome_canvas_ruler_init (GnomeCanvasRuler *ruler)
|
||||||
ruler->frames_per_unit = 1;
|
ruler->frames_per_unit = 1;
|
||||||
ruler->fill_color = 0;
|
ruler->fill_color = 0;
|
||||||
ruler->tick_color = 0;
|
ruler->tick_color = 0;
|
||||||
|
|
||||||
// GTK2FIX
|
|
||||||
//GNOME_CANVAS_ITEM(ruler)->object.flags |= GNOME_CANVAS_ITEM_NO_AUTO_REDRAW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -172,8 +172,6 @@ gnome_canvas_simpleline_init (GnomeCanvasSimpleLine *simpleline)
|
||||||
simpleline->y2 = 0.0;
|
simpleline->y2 = 0.0;
|
||||||
simpleline->color = RGBA_TO_UINT(98,123,174,241);
|
simpleline->color = RGBA_TO_UINT(98,123,174,241);
|
||||||
simpleline->horizontal = TRUE; /* reset in the _update() method */
|
simpleline->horizontal = TRUE; /* reset in the _update() method */
|
||||||
// GTK2FIX
|
|
||||||
// GNOME_CANVAS_ITEM(simpleline)->object.flags |= GNOME_CANVAS_ITEM_NO_AUTO_REDRAW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -227,9 +227,6 @@ gnome_canvas_simplerect_init (GnomeCanvasSimpleRect *simplerect)
|
||||||
simplerect->outline_color = 0;
|
simplerect->outline_color = 0;
|
||||||
simplerect->outline_pixels = 1;
|
simplerect->outline_pixels = 1;
|
||||||
simplerect->outline_what = 0xf;
|
simplerect->outline_what = 0xf;
|
||||||
|
|
||||||
// GTK2FIX
|
|
||||||
// GNOME_CANVAS_ITEM(simplerect)->object.flags |= GNOME_CANVAS_ITEM_NO_AUTO_REDRAW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -314,9 +314,6 @@ gnome_canvas_waveview_init (GnomeCanvasWaveView *waveview)
|
||||||
waveview->reload_cache_in_render = FALSE;
|
waveview->reload_cache_in_render = FALSE;
|
||||||
|
|
||||||
waveview->wave_color = RGBA_TO_UINT(44,35,126,255);
|
waveview->wave_color = RGBA_TO_UINT(44,35,126,255);
|
||||||
|
|
||||||
// GTK2FIX
|
|
||||||
// GNOME_CANVAS_ITEM(waveview)->object.flags |= GNOME_CANVAS_ITEM_NO_AUTO_REDRAW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,8 @@ Editor::add_named_selection_to_named_selection_display (NamedSelection& selectio
|
||||||
void
|
void
|
||||||
Editor::redisplay_named_selections ()
|
Editor::redisplay_named_selections ()
|
||||||
{
|
{
|
||||||
//GTK2FIX
|
|
||||||
//named_selection_display.freeze ();
|
|
||||||
named_selection_model->clear ();
|
named_selection_model->clear ();
|
||||||
session->foreach_named_selection (*this, &Editor::add_named_selection_to_named_selection_display);
|
session->foreach_named_selection (*this, &Editor::add_named_selection_to_named_selection_display);
|
||||||
//named_selection_display.thaw ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
|
|
|
||||||
|
|
@ -347,9 +347,6 @@ Editor::edit_meter_section (MeterSection* section)
|
||||||
MeterDialog meter_dialog (*section, _("done"));
|
MeterDialog meter_dialog (*section, _("done"));
|
||||||
|
|
||||||
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||||
// GTK2FIX
|
|
||||||
// meter_dialog.realize ();
|
|
||||||
// meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
|
||||||
|
|
||||||
ensure_float (meter_dialog);
|
ensure_float (meter_dialog);
|
||||||
|
|
||||||
|
|
@ -378,9 +375,6 @@ Editor::edit_tempo_section (TempoSection* section)
|
||||||
TempoDialog tempo_dialog (*section, _("done"));
|
TempoDialog tempo_dialog (*section, _("done"));
|
||||||
|
|
||||||
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||||
// GTK2FIX
|
|
||||||
// tempo_dialog.realize ();
|
|
||||||
// tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
|
|
||||||
|
|
||||||
ensure_float (tempo_dialog);
|
ensure_float (tempo_dialog);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,6 @@ ImageFrameTimeAxis::ImageFrameTimeAxis(const string & track_id, PublicEditor& ed
|
||||||
{
|
{
|
||||||
_color = unique_random_color() ;
|
_color = unique_random_color() ;
|
||||||
|
|
||||||
//GTK2FIX -- how to get the group? is the canvas display really a group?
|
|
||||||
//selection_group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_display), gnome_canvas_group_get_type (), NULL) ;
|
|
||||||
selection_group = new ArdourCanvas::Group (*canvas_display);
|
selection_group = new ArdourCanvas::Group (*canvas_display);
|
||||||
selection_group->hide();
|
selection_group->hide();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,6 @@ MarkerTimeAxisView::MarkerTimeAxisView(MarkerTimeAxis& tv)
|
||||||
region_color = _trackview.color();
|
region_color = _trackview.color();
|
||||||
stream_base_color = color_map[cMarkerTrackBase];
|
stream_base_color = color_map[cMarkerTrackBase];
|
||||||
|
|
||||||
//GTK2FIX -- how to get the group? is the canvas display really a group?
|
|
||||||
//canvas_group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(_trackview.canvas_display), gnome_canvas_group_get_type (), 0);
|
|
||||||
canvas_group = new ArdourCanvas::Group (*_trackview.canvas_display);
|
canvas_group = new ArdourCanvas::Group (*_trackview.canvas_display);
|
||||||
|
|
||||||
canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group);
|
canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group);
|
||||||
|
|
|
||||||
|
|
@ -424,10 +424,6 @@ RedirectBox::wierd_plugin_dialog (Plugin& p, uint32_t streams, IO& io)
|
||||||
dialog.set_modal (true);
|
dialog.set_modal (true);
|
||||||
dialog.show_all ();
|
dialog.show_all ();
|
||||||
|
|
||||||
// GTK2FIX
|
|
||||||
//dialog.realize();
|
|
||||||
//dialog.get_window()->set_decorations (Gdk::WMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
|
|
||||||
|
|
||||||
dialog.run ();
|
dialog.run ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -356,9 +356,6 @@ RouteParams_UI::set_session (Session *sess)
|
||||||
{
|
{
|
||||||
ArdourDialog::set_session (sess);
|
ArdourDialog::set_session (sess);
|
||||||
|
|
||||||
// GTK2FIX
|
|
||||||
// route_select_list.freeze ();
|
|
||||||
|
|
||||||
route_display_model->clear();
|
route_display_model->clear();
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
|
|
|
||||||
|
|
@ -259,9 +259,9 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
|
||||||
else
|
else
|
||||||
note_types.set_active_text (_("quarter (4)"));
|
note_types.set_active_text (_("quarter (4)"));
|
||||||
|
|
||||||
/* strings.back() just happens to be the longest one to display */
|
/* the string here needs to be the longest one to display */
|
||||||
// GTK2FIX
|
const guint32 FUDGE = 20; // Combo's are stupid - they steal space from the entry for the button
|
||||||
//Gtkmm2ext::set_size_request_to_display_given_text (note_types, "thirty-second (32)", 7, 7);
|
Gtkmm2ext::set_size_request_to_display_given_text (note_types, "thirty-second (32)", 7+FUDGE, 7);
|
||||||
|
|
||||||
hspacer1.set_border_width (5);
|
hspacer1.set_border_width (5);
|
||||||
hspacer1.pack_start (note_types, false, false);
|
hspacer1.pack_start (note_types, false, false);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class BasicUI {
|
||||||
void undo ();
|
void undo ();
|
||||||
void redo ();
|
void redo ();
|
||||||
void toggle_all_rec_enables ();
|
void toggle_all_rec_enables ();
|
||||||
|
void toggle_punch_in ();
|
||||||
|
void toggle_punch_out ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ARDOUR::Session& session;
|
ARDOUR::Session& session;
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,14 @@ BasicUI::toggle_all_rec_enables ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BasicUI::toggle_punch_in ()
|
||||||
|
{
|
||||||
|
session.set_punch_in (!session.get_punch_in());
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BasicUI::toggle_punch_out ()
|
||||||
|
{
|
||||||
|
session.set_punch_out (!session.get_punch_out());
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3212,7 +3212,7 @@ void
|
||||||
Session::set_dirty ()
|
Session::set_dirty ()
|
||||||
{
|
{
|
||||||
bool was_dirty = dirty();
|
bool was_dirty = dirty();
|
||||||
|
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state | Dirty);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | Dirty);
|
||||||
|
|
||||||
if (!was_dirty) {
|
if (!was_dirty) {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
@ -47,6 +48,23 @@ BaseUI::RequestType LEDChange = BaseUI::new_request_type ();
|
||||||
BaseUI::RequestType Print = BaseUI::new_request_type ();
|
BaseUI::RequestType Print = BaseUI::new_request_type ();
|
||||||
BaseUI::RequestType SetCurrentTrack = BaseUI::new_request_type ();
|
BaseUI::RequestType SetCurrentTrack = BaseUI::new_request_type ();
|
||||||
|
|
||||||
|
static inline double
|
||||||
|
gain_to_slider_position (ARDOUR::gain_t g)
|
||||||
|
{
|
||||||
|
if (g == 0) return 0;
|
||||||
|
return pow((6.0*log(g)/log(2.0)+192.0)/198.0, 8.0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline ARDOUR::gain_t
|
||||||
|
slider_position_to_gain (double pos)
|
||||||
|
{
|
||||||
|
/* XXX Marcus writes: this doesn't seem right to me. but i don't have a better answer ... */
|
||||||
|
if (pos == 0.0) return 0;
|
||||||
|
return pow (2.0,(sqrt(sqrt(sqrt(pos)))*198.0-192.0)/6.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TranzportControlProtocol::TranzportControlProtocol (Session& s)
|
TranzportControlProtocol::TranzportControlProtocol (Session& s)
|
||||||
: ControlProtocol (s, X_("Tranzport")),
|
: ControlProtocol (s, X_("Tranzport")),
|
||||||
AbstractUI<TranzportRequest> (X_("Tranzport"), false)
|
AbstractUI<TranzportRequest> (X_("Tranzport"), false)
|
||||||
|
|
@ -66,6 +84,7 @@ TranzportControlProtocol::TranzportControlProtocol (Session& s)
|
||||||
last_wheel_dir = 1;
|
last_wheel_dir = 1;
|
||||||
last_track_gain = FLT_MAX;
|
last_track_gain = FLT_MAX;
|
||||||
display_mode = DisplayNormal;
|
display_mode = DisplayNormal;
|
||||||
|
gain_fraction = 0.0;
|
||||||
|
|
||||||
memset (current_screen, 0, sizeof (current_screen));
|
memset (current_screen, 0, sizeof (current_screen));
|
||||||
memset (pending_screen, 0, sizeof (pending_screen));
|
memset (pending_screen, 0, sizeof (pending_screen));
|
||||||
|
|
@ -102,11 +121,15 @@ TranzportControlProtocol::set_active (bool yn)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
cerr << "Begin tranzport shutdown\n";
|
||||||
pthread_cancel_one (thread);
|
pthread_cancel_one (thread);
|
||||||
lcd_clear ();
|
cerr << "Thread dead\n";
|
||||||
|
// lcd_clear ();
|
||||||
|
// lights_off ();
|
||||||
|
// cerr << "dev reset\n";
|
||||||
close ();
|
close ();
|
||||||
_active = false;
|
_active = false;
|
||||||
|
cerr << "End tranzport shutdown\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -120,7 +143,7 @@ TranzportControlProtocol::show_track_gain ()
|
||||||
gain_t g = current_route->gain();
|
gain_t g = current_route->gain();
|
||||||
if (g != last_track_gain) {
|
if (g != last_track_gain) {
|
||||||
char buf[16];
|
char buf[16];
|
||||||
snprintf (buf, sizeof (buf), "%6.1fdB", coefficient_to_dB (current_route->gain()));
|
snprintf (buf, sizeof (buf), "%6.1fdB", coefficient_to_dB (current_route->effective_gain()));
|
||||||
print (0, 9, buf);
|
print (0, 9, buf);
|
||||||
last_track_gain = g;
|
last_track_gain = g;
|
||||||
}
|
}
|
||||||
|
|
@ -411,7 +434,7 @@ TranzportControlProtocol::lcd_clear ()
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 10; ++i) {
|
for (uint8_t i = 0; i < 10; ++i) {
|
||||||
cmd[2] = i;
|
cmd[2] = i;
|
||||||
usb_interrupt_write (udev, WRITE_ENDPOINT, (char*) cmd, 8, 500);
|
usb_interrupt_write (udev, WRITE_ENDPOINT, (char*) cmd, 8, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (current_screen, ' ', sizeof (current_screen));
|
memset (current_screen, ' ', sizeof (current_screen));
|
||||||
|
|
@ -432,31 +455,31 @@ TranzportControlProtocol::lights_off ()
|
||||||
cmd[7] = 0x00;
|
cmd[7] = 0x00;
|
||||||
|
|
||||||
cmd[2] = LightRecord;
|
cmd[2] = LightRecord;
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[LightRecord] = false;
|
lights[LightRecord] = false;
|
||||||
}
|
}
|
||||||
cmd[2] = LightTrackrec;
|
cmd[2] = LightTrackrec;
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[LightTrackrec] = false;
|
lights[LightTrackrec] = false;
|
||||||
}
|
}
|
||||||
cmd[2] = LightTrackmute;
|
cmd[2] = LightTrackmute;
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[LightTrackmute] = false;
|
lights[LightTrackmute] = false;
|
||||||
}
|
}
|
||||||
cmd[2] = LightTracksolo;
|
cmd[2] = LightTracksolo;
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[LightTracksolo] = false;
|
lights[LightTracksolo] = false;
|
||||||
}
|
}
|
||||||
cmd[2] = LightAnysolo;
|
cmd[2] = LightAnysolo;
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[LightAnysolo] = false;
|
lights[LightAnysolo] = false;
|
||||||
}
|
}
|
||||||
cmd[2] = LightLoop;
|
cmd[2] = LightLoop;
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[LightLoop] = false;
|
lights[LightLoop] = false;
|
||||||
}
|
}
|
||||||
cmd[2] = LightPunch;
|
cmd[2] = LightPunch;
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[LightPunch] = false;
|
lights[LightPunch] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -477,7 +500,7 @@ TranzportControlProtocol::light_on (LightID light)
|
||||||
cmd[6] = 0x00;
|
cmd[6] = 0x00;
|
||||||
cmd[7] = 0x00;
|
cmd[7] = 0x00;
|
||||||
|
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[light] = true;
|
lights[light] = true;
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -505,7 +528,7 @@ TranzportControlProtocol::light_off (LightID light)
|
||||||
cmd[6] = 0x00;
|
cmd[6] = 0x00;
|
||||||
cmd[7] = 0x00;
|
cmd[7] = 0x00;
|
||||||
|
|
||||||
if (write (cmd, 500) == 0) {
|
if (write (cmd, 1000) == 0) {
|
||||||
lights[light] = false;
|
lights[light] = false;
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -524,6 +547,7 @@ TranzportControlProtocol::monitor_work ()
|
||||||
int err;
|
int err;
|
||||||
uint8_t buf[8];
|
uint8_t buf[8];
|
||||||
int val;
|
int val;
|
||||||
|
bool first_time = true;
|
||||||
|
|
||||||
PBD::ThreadCreated (pthread_self(), X_("Tranzport"));
|
PBD::ThreadCreated (pthread_self(), X_("Tranzport"));
|
||||||
|
|
||||||
|
|
@ -538,26 +562,22 @@ TranzportControlProtocol::monitor_work ()
|
||||||
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, 0);
|
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, 0);
|
||||||
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
||||||
|
|
||||||
/* set initial state */
|
|
||||||
|
|
||||||
lcd_clear ();
|
|
||||||
lights_off ();
|
|
||||||
|
|
||||||
show_wheel_mode();
|
|
||||||
next_track ();
|
next_track ();
|
||||||
show_transport_time ();
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
/* bInterval for this beastie is 10ms */
|
/* bInterval for this beastie is 10ms */
|
||||||
|
|
||||||
pthread_testcancel();
|
|
||||||
usleep (20000);
|
|
||||||
pthread_testcancel();
|
|
||||||
|
|
||||||
/* anything to read ? */
|
/* anything to read ? */
|
||||||
|
|
||||||
val = usb_interrupt_read (udev, READ_ENDPOINT, (char*) buf, 8, 0);
|
if (_device_status == STATUS_OFFLINE) {
|
||||||
|
light_off (LightRecord);
|
||||||
|
first_time = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
pthread_testcancel();
|
||||||
|
val = usb_interrupt_read (udev, READ_ENDPOINT, (char*) buf, 8, 10);
|
||||||
|
pthread_testcancel();
|
||||||
|
|
||||||
/* any requests to handle? */
|
/* any requests to handle? */
|
||||||
|
|
||||||
|
|
@ -567,9 +587,15 @@ TranzportControlProtocol::monitor_work ()
|
||||||
process (buf);
|
process (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update whatever needs updating */
|
if (_device_status != STATUS_OFFLINE) {
|
||||||
|
if (first_time) {
|
||||||
update_state ();
|
lcd_clear ();
|
||||||
|
lights_off ();
|
||||||
|
first_time = false;
|
||||||
|
}
|
||||||
|
/* update whatever needs updating */
|
||||||
|
update_state ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (void*) 0;
|
return (void*) 0;
|
||||||
|
|
@ -620,7 +646,7 @@ TranzportControlProtocol::update_state ()
|
||||||
cmd[6] = pending_screen[row][col_base+3];
|
cmd[6] = pending_screen[row][col_base+3];
|
||||||
cmd[7] = 0x00;
|
cmd[7] = 0x00;
|
||||||
|
|
||||||
if (usb_interrupt_write (udev, WRITE_ENDPOINT, (char *) cmd, 8, 500) == 8) {
|
if (usb_interrupt_write (udev, WRITE_ENDPOINT, (char *) cmd, 8, 1000) == 8) {
|
||||||
/* successful write: copy to current */
|
/* successful write: copy to current */
|
||||||
memcpy (¤t_screen[row][col_base], &pending_screen[row][col_base], 4);
|
memcpy (¤t_screen[row][col_base], &pending_screen[row][col_base], 4);
|
||||||
}
|
}
|
||||||
|
|
@ -1049,6 +1075,8 @@ void
|
||||||
TranzportControlProtocol::button_event_in_press (bool shifted)
|
TranzportControlProtocol::button_event_in_press (bool shifted)
|
||||||
{
|
{
|
||||||
if (shifted) {
|
if (shifted) {
|
||||||
|
toggle_punch_in ();
|
||||||
|
} else {
|
||||||
ControlProtocol::ZoomIn (); /* EMIT SIGNAL */
|
ControlProtocol::ZoomIn (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1062,6 +1090,8 @@ void
|
||||||
TranzportControlProtocol::button_event_out_press (bool shifted)
|
TranzportControlProtocol::button_event_out_press (bool shifted)
|
||||||
{
|
{
|
||||||
if (shifted) {
|
if (shifted) {
|
||||||
|
toggle_punch_out ();
|
||||||
|
} else {
|
||||||
ControlProtocol::ZoomOut (); /* EMIT SIGNAL */
|
ControlProtocol::ZoomOut (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1353,20 +1383,32 @@ void
|
||||||
TranzportControlProtocol::step_gain_up ()
|
TranzportControlProtocol::step_gain_up ()
|
||||||
{
|
{
|
||||||
if (buttonmask & ButtonStop) {
|
if (buttonmask & ButtonStop) {
|
||||||
current_route->inc_gain (0.01, this);
|
gain_fraction += 0.001;
|
||||||
} else {
|
} else {
|
||||||
current_route->inc_gain (0.1, this);
|
gain_fraction += 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gain_fraction > 2.0) {
|
||||||
|
gain_fraction = 2.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
current_route->set_gain (slider_position_to_gain (gain_fraction), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TranzportControlProtocol::step_gain_down ()
|
TranzportControlProtocol::step_gain_down ()
|
||||||
{
|
{
|
||||||
if (buttonmask & ButtonStop) {
|
if (buttonmask & ButtonStop) {
|
||||||
current_route->inc_gain (-0.01, this);
|
gain_fraction -= 0.001;
|
||||||
} else {
|
} else {
|
||||||
current_route->inc_gain (-0.1, this);
|
gain_fraction -= 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gain_fraction < 0.0) {
|
||||||
|
gain_fraction = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
current_route->set_gain (slider_position_to_gain (gain_fraction), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1444,6 +1486,7 @@ TranzportControlProtocol::next_track ()
|
||||||
}
|
}
|
||||||
|
|
||||||
current_route = cr;
|
current_route = cr;
|
||||||
|
gain_fraction = gain_to_slider_position (current_route->effective_gain());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1477,6 +1520,7 @@ TranzportControlProtocol::prev_track ()
|
||||||
}
|
}
|
||||||
|
|
||||||
current_route = cr;
|
current_route = cr;
|
||||||
|
gain_fraction = gain_to_slider_position (current_route->effective_gain());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -100,11 +100,13 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol, public Abstract
|
||||||
uint8_t _datawheel;
|
uint8_t _datawheel;
|
||||||
uint8_t _device_status;
|
uint8_t _device_status;
|
||||||
usb_dev_handle* udev;
|
usb_dev_handle* udev;
|
||||||
|
|
||||||
ARDOUR::Route* current_route;
|
ARDOUR::Route* current_route;
|
||||||
uint32_t current_track_id;
|
uint32_t current_track_id;
|
||||||
WheelMode wheel_mode;
|
WheelMode wheel_mode;
|
||||||
WheelShiftMode wheel_shift_mode;
|
WheelShiftMode wheel_shift_mode;
|
||||||
DisplayMode display_mode;
|
DisplayMode display_mode;
|
||||||
|
ARDOUR::gain_t gain_fraction;
|
||||||
|
|
||||||
void do_request (TranzportRequest*);
|
void do_request (TranzportRequest*);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue