seperate equalizer.* into equalizerwindow.* and equalizerwidget.*
clean up some headers
This commit is contained in:
parent
a228d7a01b
commit
67dade4e4b
15 changed files with 159 additions and 100 deletions
|
@ -13,6 +13,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include "PosBar.h"
|
#include "PosBar.h"
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "maindisplay.h"
|
#include "maindisplay.h"
|
||||||
#include "TimeDisplay.h"
|
#include "TimeDisplay.h"
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "TitleBar.h"
|
#include "TitleBar.h"
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
HEADERS += equalizer.h
|
HEADERS += equalizerwindow.h \
|
||||||
|
equalizerwidget.h
|
||||||
|
|
||||||
SOURCES += equalizer.cpp
|
SOURCES += equalizerwindow.cpp \
|
||||||
|
equalizerwidget.cpp
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
DEPENDPATH += $$PWD
|
DEPENDPATH += $$PWD
|
||||||
|
|
|
@ -13,64 +13,14 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
|
#include "equalizerwidget.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "TitleBar.h"
|
|
||||||
#include "equalizer.h"
|
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
#include "VolumeSlider.h"
|
#include "VolumeSlider.h"
|
||||||
|
|
||||||
EqualizerWindow::EqualizerWindow (QWidget *parent) : QMainWindow (parent)
|
|
||||||
{
|
|
||||||
m_mw = dynamic_cast<MainWindow *>(parent);
|
|
||||||
|
|
||||||
setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint);
|
|
||||||
setAttribute (Qt::WA_DeleteOnClose);
|
|
||||||
|
|
||||||
m_equalizer = new EqualizerWidget (this);
|
|
||||||
m_equalizer->show();
|
|
||||||
|
|
||||||
setCentralWidget (m_equalizer);
|
|
||||||
|
|
||||||
setFixedSize (275, 116);
|
|
||||||
}
|
|
||||||
|
|
||||||
EqualizerWindow::~EqualizerWindow (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
EqualizerWindow::setEnabled (void)
|
|
||||||
{
|
|
||||||
qDebug ("test");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
EqualizerWindow::mousePressEvent (QMouseEvent *event)
|
|
||||||
{
|
|
||||||
m_diffx = event->pos().x();
|
|
||||||
m_diffy = event->pos().y();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
EqualizerWindow::mouseMoveEvent (QMouseEvent *event)
|
|
||||||
{
|
|
||||||
move(event->globalPos().x() - m_diffx,
|
|
||||||
event->globalPos().y() - m_diffy);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
EqualizerWindow::moveEvent (QMoveEvent *event)
|
|
||||||
{
|
|
||||||
QSettings s;
|
|
||||||
s.setValue ("equalizer/pos", pos ());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* EqualizerWidget
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
EqualizerWidget::EqualizerWidget (QWidget *parent) : QWidget (parent)
|
EqualizerWidget::EqualizerWidget (QWidget *parent) : QWidget (parent)
|
||||||
{
|
{
|
||||||
Skin *skin = Skin::getInstance ();
|
Skin *skin = Skin::getInstance ();
|
|
@ -13,25 +13,19 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __EQUALIZER_H__
|
#ifndef __EQUALIZERWIDGET_H__
|
||||||
#define __EQUALIZER_H__
|
#define __EQUALIZERWIDGET_H__
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
class QPixmap;
|
||||||
|
class QPaintEvent;
|
||||||
|
|
||||||
class Skin;
|
class Skin;
|
||||||
class Button;
|
class Button;
|
||||||
class MainWindow;
|
|
||||||
class TitleBar;
|
|
||||||
class ToggleButton;
|
class ToggleButton;
|
||||||
class Slider;
|
class Slider;
|
||||||
|
|
||||||
#include <iostream>
|
//#include <iostream>
|
||||||
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QMainWindow>
|
|
||||||
|
|
||||||
#include "Display.h"
|
|
||||||
|
|
||||||
class EqualizerWidget : public QWidget
|
class EqualizerWidget : public QWidget
|
||||||
{
|
{
|
||||||
|
@ -43,6 +37,7 @@ class EqualizerWidget : public QWidget
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setPixmaps(Skin *skin);
|
void setPixmaps(Skin *skin);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPixmap m_pixmap;
|
QPixmap m_pixmap;
|
||||||
QPixmap m_graph;
|
QPixmap m_graph;
|
||||||
|
@ -53,25 +48,5 @@ class EqualizerWidget : public QWidget
|
||||||
Slider *m_bands[10];
|
Slider *m_bands[10];
|
||||||
};
|
};
|
||||||
|
|
||||||
class EqualizerWindow : public QMainWindow
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
EqualizerWindow(QWidget *parent);
|
|
||||||
~EqualizerWindow();
|
|
||||||
void mouseMoveEvent(QMouseEvent *);
|
|
||||||
void mousePressEvent(QMouseEvent *);
|
|
||||||
void moveEvent(QMoveEvent *event);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setEnabled (void);
|
|
||||||
|
|
||||||
private:
|
|
||||||
MainWindow *m_mw;
|
|
||||||
EqualizerWidget *m_equalizer;
|
|
||||||
int m_diffx;
|
|
||||||
int m_diffy;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
73
src/equalizer/equalizerwindow.cpp
Normal file
73
src/equalizer/equalizerwindow.cpp
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
/**
|
||||||
|
* This file is a part of Prome, an XMMS2 Client.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 XMMS2 Team
|
||||||
|
*
|
||||||
|
* 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; version 2 of the License.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
|
#include "equalizerwindow.h"
|
||||||
|
|
||||||
|
#include "QWidget"
|
||||||
|
#include <QSettings>
|
||||||
|
#include <QMouseEvent>
|
||||||
|
#include <QMoveEvent>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "equalizerwidget.h"
|
||||||
|
|
||||||
|
EqualizerWindow::EqualizerWindow (QWidget *parent) : QMainWindow (parent)
|
||||||
|
{
|
||||||
|
m_mw = dynamic_cast<MainWindow *>(parent);
|
||||||
|
|
||||||
|
setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint);
|
||||||
|
setAttribute (Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
|
m_equalizer = new EqualizerWidget (this);
|
||||||
|
m_equalizer->show();
|
||||||
|
|
||||||
|
setCentralWidget (m_equalizer);
|
||||||
|
|
||||||
|
setFixedSize (275, 116);
|
||||||
|
}
|
||||||
|
|
||||||
|
EqualizerWindow::~EqualizerWindow (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EqualizerWindow::setEnabled (void)
|
||||||
|
{
|
||||||
|
qDebug ("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
EqualizerWindow::mousePressEvent (QMouseEvent *event)
|
||||||
|
{
|
||||||
|
m_diffx = event->pos().x();
|
||||||
|
m_diffy = event->pos().y();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EqualizerWindow::mouseMoveEvent (QMouseEvent *event)
|
||||||
|
{
|
||||||
|
move(event->globalPos().x() - m_diffx,
|
||||||
|
event->globalPos().y() - m_diffy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EqualizerWindow::moveEvent (QMoveEvent *event)
|
||||||
|
{
|
||||||
|
QSettings s;
|
||||||
|
s.setValue ("equalizer/pos", pos ());
|
||||||
|
}
|
48
src/equalizer/equalizerwindow.h
Normal file
48
src/equalizer/equalizerwindow.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/**
|
||||||
|
* This file is a part of Prome, an XMMS2 Client.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 XMMS2 Team
|
||||||
|
*
|
||||||
|
* 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; version 2 of the License.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __EQUALIZERWINDOW_H__
|
||||||
|
#define __EQUALIZERWINDOW_H__
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
class QWidget;
|
||||||
|
class QMouseEvent;
|
||||||
|
class QMoveEvent;
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
class EqualizerWidget;
|
||||||
|
|
||||||
|
class EqualizerWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
EqualizerWindow(QWidget *parent);
|
||||||
|
~EqualizerWindow();
|
||||||
|
void mouseMoveEvent(QMouseEvent *);
|
||||||
|
void mousePressEvent(QMouseEvent *);
|
||||||
|
void moveEvent(QMoveEvent *event);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setEnabled (void);
|
||||||
|
|
||||||
|
private:
|
||||||
|
MainWindow *m_mw;
|
||||||
|
EqualizerWidget *m_equalizer;
|
||||||
|
int m_diffx;
|
||||||
|
int m_diffy;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __EQUALIZERWINDOW_H__
|
|
@ -13,12 +13,13 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "playlistwindow.h"
|
// #include "playlistwindow.h"
|
||||||
#include "equalizer.h"
|
#include "equalizerwindow.h"
|
||||||
#include "Skin.h"
|
#include "Skin.h"
|
||||||
//TODO: change to xclient.h sometime later
|
//TODO: change to xclient.h sometime later
|
||||||
#include "XMMSHandler.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_SERVERBROWSER
|
#ifdef HAVE_SERVERBROWSER
|
||||||
#include "Serverbrowser.h"
|
#include "Serverbrowser.h"
|
||||||
|
|
|
@ -230,8 +230,8 @@ MainDisplay::SetupToggleButtons (void)
|
||||||
Skin::EQ_OFF_0, Skin::EQ_OFF_1);
|
Skin::EQ_OFF_0, Skin::EQ_OFF_1);
|
||||||
m_eq->move(219, 58);
|
m_eq->move(219, 58);
|
||||||
if (!s.value ("equalizer/hidden").toBool ())
|
if (!s.value ("equalizer/hidden").toBool ())
|
||||||
m_pls->toggle ();
|
m_eq->toggle ();
|
||||||
m_eq->setEnabled(false); // FIXME: Disabled for now, equalizer doesn't work yet
|
m_eq->setEnabled(false); // FIXME: Disabled for now, equalizer doesn't work yet
|
||||||
|
|
||||||
connect (m_eq, SIGNAL(clicked()), this, SLOT(toggleEQ()));
|
connect (m_eq, SIGNAL(clicked()), this, SLOT(toggleEQ()));
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#ifdef HAVE_SERVERBROWSER
|
#ifdef HAVE_SERVERBROWSER
|
||||||
|
@ -22,7 +24,7 @@
|
||||||
#include "playlistwindow.h"
|
#include "playlistwindow.h"
|
||||||
#include "maindisplay.h"
|
#include "maindisplay.h"
|
||||||
#include "shadeddisplay.h"
|
#include "shadeddisplay.h"
|
||||||
#include "equalizer.h"
|
#include "equalizerwindow.h"
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
#ifndef __MAINWINDOW_H__
|
#ifndef __MAINWINDOW_H__
|
||||||
#define __MAINWINDOW_H__
|
#define __MAINWINDOW_H__
|
||||||
|
|
||||||
#include "XMMSHandler.h"
|
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "XMMSHandler.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "BrowseDialog.h"
|
#include "BrowseDialog.h"
|
||||||
#include "playlistwindow.h"
|
#include "playlistwindow.h"
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PLAYLISTWINDOW_
|
#ifndef __PLAYLISTWINDOW_H__
|
||||||
#define _PLAYLISTWINDOW_
|
#define __PLAYLISTWINDOW_H__
|
||||||
|
|
||||||
// Qt classes
|
// Qt classes
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
@ -72,4 +72,4 @@ class PlaylistWindow : public QMainWindow {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _PLAYLISTWINDOW_
|
#endif // __PLAYLISTWINDOW_H__
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue