Parent: [d30a23] (diff)

Child: [01447a] (diff)

Download this file

mw_connections.cpp    129 lines (103 with data), 5.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* Copyright (C) 2013 Lucio Carreras
*
* This file is part of sayonara player
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mainw.h"
void GUI_Player::setupConnections()
{
connect(ui->player_w->playctl(), SIGNAL(playrequested()),
this, SLOT(onPlayActivated()));
connect(ui->player_w->playctl(), SIGNAL(pauserequested()),
this, SLOT(onPauseActivated()));
connect(ui->player_w->playctl(), SIGNAL(forwardrequested()),
this, SLOT(onForwardActivated()));
connect(ui->player_w->playctl(), SIGNAL(backwardrequested()),
this, SLOT(onBackwardActivated()));
connect(ui->player_w->playctl(), SIGNAL(stoprequested()),
this, SLOT(onStopActivated()));
connect(ui->player_w->volume(), SIGNAL(muteChanged(bool)),
this, SLOT(onMuteActivated(bool)));
connect(ui->player_w->volume(), SIGNAL(volumeChanged(int)),
this, SIGNAL(sig_volume_changed(int)));
connect(ui->player_w->progress(), SIGNAL(seekRequested(int)),
this, SIGNAL(sig_seek(int)));
// file
connect(ui->actionSelect_Media_Renderer, SIGNAL(triggered(bool)),
this, SIGNAL(sig_choose_renderer()));
connect(ui->actionSelect_OH_Source, SIGNAL(triggered(bool)),
this, SIGNAL(sig_choose_source()));
connect(ui->actionSave_Playlist, SIGNAL(triggered(bool)),
this, SIGNAL(sig_save_playlist()));
connect(ui->actionLoad_Playlist, SIGNAL(triggered(bool)),
this, SIGNAL(sig_load_playlist()));
connect(ui->actionOpen_Songcast, SIGNAL(triggered(bool)),
this, SIGNAL(sig_open_songcast()));
connect(ui->action_Close, SIGNAL(triggered(bool)), this,
SLOT(really_close(bool)));
// view
connect(ui->action_viewLibrary, SIGNAL(toggled(bool)), this,
SLOT(showLibrary(bool)));
connect(ui->action_viewSearchPanel, SIGNAL(toggled(bool)), this,
SIGNAL(showSearchPanel(bool)));
connect(ui->action_Dark, SIGNAL(toggled(bool)), this,
SLOT(changeSkin(bool)));
connect(ui->action_smallPlaylistItems, SIGNAL(toggled(bool)), this,
SLOT(small_playlist_items_toggled(bool)));
connect(ui->action_Fullscreen, SIGNAL(toggled(bool)), this,
SLOT(show_fullscreen_toggled(bool)));
connect(ui->action_Preferences, SIGNAL(triggered(bool)), this,
SIGNAL(sig_preferences()));
// about
connect(ui->action_about, SIGNAL(triggered(bool)), this, SLOT(about(bool)));
connect(ui->action_help, SIGNAL(triggered(bool)), this, SLOT(help(bool)));
connect(m_trayIcon, SIGNAL(sig_volume_changed_by_wheel(int)),
this, SLOT(onVolumeStepActivated(int)));
QList<QKeySequence> lst;
lst << QKeySequence(Qt::Key_MediaTogglePlayPause) <<
QKeySequence(Qt::Key_MediaPlay) << QKeySequence(Qt::Key_MediaPause) <<
QKeySequence(Qt::Key_Space);
QAction* play_pause_action = createAction(lst);
connect(play_pause_action, SIGNAL(triggered()),
ui->player_w->playctl(), SLOT(onPlayClicked()));
QList<QKeySequence> lst_fwd;
lst_fwd << QKeySequence(Qt::Key_MediaNext) <<
QKeySequence(Qt::ControlModifier | Qt::Key_Right);
QAction* fwd_action = createAction(lst_fwd);
connect(fwd_action, SIGNAL(triggered()),
ui->player_w->playctl(), SLOT(onForwardClicked()));
QList<QKeySequence> lst_bwd;
lst_bwd << QKeySequence(Qt::Key_MediaPrevious) <<
QKeySequence(Qt::ControlModifier | Qt::Key_Left);
QAction* bwd_action = createAction(lst_bwd);
connect(bwd_action, SIGNAL(triggered()),
ui->player_w->playctl(), SLOT(onBackwardClicked()));
QAction* stop_action = createAction(QKeySequence(Qt::ControlModifier |
Qt::Key_Space));
connect(stop_action, SIGNAL(triggered()),
ui->player_w->playctl(), SLOT(onStopClicked()));
QAction* louder_action = createAction(QKeySequence(Qt::AltModifier |
Qt::Key_Up));
connect(louder_action, SIGNAL(triggered()), this, SLOT(onVolumeHigherActivated()));
QAction* leiser_action = createAction(QKeySequence(Qt::AltModifier |
Qt::Key_Down));
connect(leiser_action, SIGNAL(triggered()), this, SLOT(onVolumeLowerActivated()));
QAction* two_perc_plus_action = createAction(QKeySequence(Qt::AltModifier |
Qt::Key_Right));
connect(two_perc_plus_action, SIGNAL(triggered()),
this, SLOT(onJumpForwardActivated()));
QAction* two_perc_minus_action = createAction(QKeySequence(Qt::AltModifier |
Qt::Key_Left));
connect(two_perc_minus_action, SIGNAL(triggered()),
this, SLOT(onJumpBackwardActivated()));
}