Parent: [a2139d] (diff)

Child: [ef14c6] (diff)

Download this file

GUI_PlayerConnections.cpp    110 lines (87 with data), 4.8 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
/* GUI_PlayerConnections.cpp */
/* 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 "GUI/player/GUI_Player.h"
void GUI_Player::setupConnections()
{
connect(ui->btn_play, SIGNAL(clicked(bool)), this,
SLOT(playClicked(bool)));
connect(ui->btn_fw, SIGNAL(clicked(bool)), this,
SLOT(forwardClicked(bool)));
connect(ui->btn_bw, SIGNAL(clicked(bool)), this,
SLOT(backwardClicked(bool)));
connect(ui->btn_stop, SIGNAL(clicked()), this,
SLOT(stopClicked()));
connect(ui->btn_mute, SIGNAL(released()), this,
SLOT(muteButtonPressed()));
connect(ui->albumCover, SIGNAL(clicked()), this, SLOT(coverClicked()));
// file
connect(ui->actionChange_Media_Renderer, SIGNAL(triggered(bool)),
this, SIGNAL(sig_choose_renderer()));
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->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)));
// preferencesF
connect(ui->action_min2tray, SIGNAL(toggled(bool)), this,
SLOT(min2tray_toggled(bool)));
connect(ui->action_sortprefs, SIGNAL(triggered(bool)), this,
SIGNAL(sig_sortprefs()));
// 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(volumeChangedByTick(int)));
connect(ui->volumeSlider, SIGNAL(valueChanged(int)), this,
SLOT(volumeChanged(int)));
connect(ui->songProgress, SIGNAL(valueChanged(int)), this,
SLOT(setProgressJump(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->btn_play, SLOT(click()));
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->btn_fw, SLOT(click()));
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->btn_bw, SLOT(click()));
QAction* stop_action = createAction(QKeySequence(Qt::ControlModifier | Qt::Key_Space));
connect(stop_action, SIGNAL(triggered()), ui->btn_stop, SLOT(click()));
QAction* louder_action = createAction(QKeySequence(Qt::AltModifier | Qt::Key_Up));
connect(louder_action, SIGNAL(triggered()), this, SLOT(volumeHigher()));
QAction* leiser_action = createAction(QKeySequence(Qt::AltModifier | Qt::Key_Down));
connect(leiser_action, SIGNAL(triggered()), this, SLOT(volumeLower()));
QAction* two_perc_plus_action = createAction(QKeySequence(Qt::AltModifier | Qt::Key_Right));
connect(two_perc_plus_action, SIGNAL(triggered()), this, SLOT(jump_forward()));
QAction* two_perc_minus_action = createAction(QKeySequence(Qt::AltModifier | Qt::Key_Left));
connect(two_perc_minus_action, SIGNAL(triggered()), this, SLOT(jump_backward()));
}