Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/engine/enginechannel.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           enginechannel.cpp  -  description
00003                              -------------------
00004     begin                : Sun Apr 28 2002
00005     copyright            : (C) 2002 by
00006     email                :
00007 ***************************************************************************/
00008 
00009 /***************************************************************************
00010 *                                                                         *
00011 *   This program is free software; you can redistribute it and/or modify  *
00012 *   it under the terms of the GNU General Public License as published by  *
00013 *   the Free Software Foundation; either version 2 of the License, or     *
00014 *   (at your option) any later version.                                   *
00015 *                                                                         *
00016 ***************************************************************************/
00017 
00018 #include "engine/enginechannel.h"
00019 
00020 #include "controlobject.h"
00021 #include "controlpushbutton.h"
00022 
00023 EngineChannel::EngineChannel(const char* pGroup,
00024                              EngineChannel::ChannelOrientation defaultOrientation)
00025         : m_group(pGroup) {
00026     m_pPFL = new ControlPushButton(ConfigKey(m_group, "pfl"));
00027     m_pPFL->setToggleButton(true);
00028     m_pOrientation = new ControlObject(ConfigKey(m_group, "orientation"));
00029     m_pOrientation->set(defaultOrientation);
00030 }
00031 
00032 EngineChannel::~EngineChannel() {
00033     delete m_pPFL;
00034     delete m_pOrientation;
00035 }
00036 
00037 const QString& EngineChannel::getGroup() const {
00038     return m_group;
00039 }
00040 
00041 bool EngineChannel::isPFL() {
00042     return m_pPFL->get() == 1.0;
00043 }
00044 
00045 bool EngineChannel::isMaster() {
00046     return true;
00047 }
00048 
00049 EngineChannel::ChannelOrientation EngineChannel::getOrientation() {
00050     double dOrientation = m_pOrientation->get();
00051     if (dOrientation == LEFT) {
00052         return LEFT;
00053     } else if (dOrientation == CENTER) {
00054         return CENTER;
00055     } else if (dOrientation == RIGHT) {
00056         return RIGHT;
00057     }
00058     return CENTER;
00059 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines