Advanced Settings Panel
[pierogi] / forms / pirmediaform.cpp
1 #include "pirmediaform.h"
2 #include "ui_pirmediaform.h"
3
4 #include "mainwindow.h"
5 #include "pirkeysetmanager.h"
6
7 PIRMediaForm::PIRMediaForm(
8   MainWindow *mw)
9   : QWidget(0),
10     ui(new Ui::PIRMediaForm),
11     mainWindow(mw)
12 {
13   ui->setupUi(this);
14 }
15
16 PIRMediaForm::~PIRMediaForm()
17 {
18   delete ui;
19 }
20
21
22 void PIRMediaForm::enableButtons(
23   const PIRKeysetManager *keyset,
24   unsigned int id)
25 {
26   emit nextEnabled(keyset->hasKey(id, Next_Key));
27   emit previousEnabled(keyset->hasKey(id, Previous_Key));
28   emit advanceEnabled(keyset->hasKey(id, Advance_Key));
29   emit replayEnabled(keyset->hasKey(id, Replay_Key));
30   emit stepForwardEnabled(keyset->hasKey(id, StepForward_Key));
31   emit stepBackEnabled(keyset->hasKey(id, StepBack_Key));
32   emit fastForwardEnabled(keyset->hasKey(id, FastForward_Key));
33   emit reverseEnabled(keyset->hasKey(id, Rewind_Key));
34   emit playEnabled(keyset->hasKey(id, Play_Key));
35   emit pauseEnabled(keyset->hasKey(id, Pause_Key));
36   emit stopEnabled(keyset->hasKey(id, Stop_Key));
37   emit ejectEnabled(keyset->hasKey(id, Eject_Key));
38 }
39
40
41 void PIRMediaForm::on_mediaPreviousButton_pressed()
42 {
43   mainWindow->startRepeating(Previous_Key);
44 }
45
46 void PIRMediaForm::on_mediaPreviousButton_released()
47 {
48   mainWindow->stopRepeating();
49 }
50
51 void PIRMediaForm::on_mediaNextButton_pressed()
52 {
53   mainWindow->startRepeating(Next_Key);
54 }
55
56 void PIRMediaForm::on_mediaNextButton_released()
57 {
58   mainWindow->stopRepeating();
59 }
60
61 void PIRMediaForm::on_replayButton_pressed()
62 {
63   mainWindow->startRepeating(Replay_Key);
64 }
65
66 void PIRMediaForm::on_replayButton_released()
67 {
68   mainWindow->stopRepeating();
69 }
70
71 void PIRMediaForm::on_advanceButton_pressed()
72 {
73   mainWindow->startRepeating(Advance_Key);
74 }
75
76 void PIRMediaForm::on_advanceButton_released()
77 {
78   mainWindow->stopRepeating();
79 }
80
81 void PIRMediaForm::on_stepBackButton_pressed()
82 {
83   mainWindow->startRepeating(StepBack_Key);
84 }
85
86 void PIRMediaForm::on_stepBackButton_released()
87 {
88   mainWindow->stopRepeating();
89 }
90
91 void PIRMediaForm::on_stepForwardButton_pressed()
92 {
93   mainWindow->startRepeating(StepForward_Key);
94 }
95
96 void PIRMediaForm::on_stepForwardButton_released()
97 {
98   mainWindow->stopRepeating();
99 }
100
101 void PIRMediaForm::on_reverseButton_pressed()
102 {
103   mainWindow->startRepeating(Rewind_Key);
104 }
105
106 void PIRMediaForm::on_reverseButton_released()
107 {
108   mainWindow->stopRepeating();
109 }
110
111 void PIRMediaForm::on_fastForwardButton_pressed()
112 {
113   mainWindow->startRepeating(FastForward_Key);
114 }
115
116 void PIRMediaForm::on_fastForwardButton_released()
117 {
118   mainWindow->stopRepeating();
119 }
120
121 void PIRMediaForm::on_playButton_pressed()
122 {
123   mainWindow->startRepeating(Play_Key);
124 }
125
126 void PIRMediaForm::on_playButton_released()
127 {
128   mainWindow->stopRepeating();
129 }
130
131 void PIRMediaForm::on_pauseButton_pressed()
132 {
133   mainWindow->startRepeating(Pause_Key);
134 }
135
136 void PIRMediaForm::on_pauseButton_released()
137 {
138   mainWindow->stopRepeating();
139 }
140
141 void PIRMediaForm::on_stopButton_pressed()
142 {
143   mainWindow->startRepeating(Stop_Key);
144 }
145
146 void PIRMediaForm::on_stopButton_released()
147 {
148   mainWindow->stopRepeating();
149 }
150
151 void PIRMediaForm::on_ejectButton_pressed()
152 {
153   mainWindow->startRepeating(Eject_Key);
154 }
155
156 void PIRMediaForm::on_ejectButton_released()
157 {
158   mainWindow->stopRepeating();
159 }