~ubuntu-branches/ubuntu/utopic/ardour3/utopic

« back to all changes in this revision

Viewing changes to libs/surfaces/tranzport/mode.cc

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2013-09-21 19:05:02 UTC
  • Revision ID: package-import@ubuntu.com-20130921190502-8gsftrku6jnzhd7v
Tags: upstream-3.4~dfsg
ImportĀ upstreamĀ versionĀ 3.4~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright (C) 2006 Paul Davis 
 
3
 *   Copyright (C) 2007 Michael Taht
 
4
 *
 
5
 *   This program is free software; you can redistribute it and/or modify
 
6
 *   it under the terms of the GNU General Public License as published by
 
7
 *   the Free Software Foundation; either version 2 of the License, or
 
8
 *   (at your option) any later version.
 
9
 *
 
10
 *   This program is distributed in the hope that it will be useful,
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *   GNU General Public License for more details.
 
14
 *
 
15
 *   You should have received a copy of the GNU General Public License
 
16
 *   along with this program; if not, write to the Free Software
 
17
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
 *  
 
19
 *   */
 
20
 
 
21
#include <tranzport_control_protocol.h>
 
22
 
 
23
void
 
24
TranzportControlProtocol::normal_update ()
 
25
{
 
26
        show_current_track ();
 
27
        show_transport_time ();
 
28
        show_track_gain ();
 
29
        show_wheel_mode ();
 
30
}
 
31
 
 
32
void
 
33
TranzportControlProtocol::next_display_mode ()
 
34
{
 
35
        switch (display_mode) {
 
36
 
 
37
        case DisplayNormal:
 
38
                enter_big_meter_mode();
 
39
                break;
 
40
 
 
41
        case DisplayBigMeter:
 
42
                enter_normal_display_mode();
 
43
                break;
 
44
 
 
45
        case DisplayRecording:
 
46
                enter_normal_display_mode();
 
47
                break;
 
48
 
 
49
        case DisplayRecordingMeter:
 
50
                enter_big_meter_mode();
 
51
                break;
 
52
 
 
53
        case DisplayConfig: 
 
54
        case DisplayBling:
 
55
        case DisplayBlingMeter:
 
56
                enter_normal_display_mode();
 
57
                break;
 
58
        }
 
59
}
 
60
 
 
61
// FIXME: There should be both enter and exits
 
62
// EXIT would erase the portions of the screen being written
 
63
// to.
 
64
/* not sure going macro crazy is a good idea
 
65
#define DECLARE_ENTER_MODE(mode,modename) void TranzportControlProtocol::enter_##mode##_mode() \{\screen_clear(); lights_off(); display_mode=Display##modename;\;
 
66
*/
 
67
void
 
68
TranzportControlProtocol::enter_recording_mode ()
 
69
{
 
70
        screen_clear ();
 
71
        lights_off ();
 
72
        display_mode = DisplayRecording;
 
73
}
 
74
 
 
75
void
 
76
TranzportControlProtocol::enter_bling_mode ()
 
77
{
 
78
        screen_clear ();
 
79
        lights_off ();
 
80
        display_mode = DisplayBling;
 
81
}
 
82
 
 
83
void
 
84
TranzportControlProtocol::enter_config_mode ()
 
85
{
 
86
        lights_off ();
 
87
        screen_clear ();
 
88
        display_mode = DisplayConfig;
 
89
}
 
90
 
 
91
 
 
92
void
 
93
TranzportControlProtocol::enter_big_meter_mode ()
 
94
{
 
95
        lights_off (); // it will clear the screen for you
 
96
        last_meter_fill = 0;
 
97
        display_mode = DisplayBigMeter;
 
98
}
 
99
 
 
100
void
 
101
TranzportControlProtocol::enter_normal_display_mode ()
 
102
{
 
103
        lights_off ();
 
104
        screen_clear ();
 
105
        display_mode = DisplayNormal;
 
106
}
 
107