summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets/SoundUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-02-23 20:24:14 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-02-23 20:28:12 -0500
commitcd9396d859cbba795c945796a6a0790a6c5c00a3 (patch)
tree7ee18954a884e430b685b64686d8985ecf6c9a86 /sigmodr/widgets/SoundUI.cpp
parent3479836bc56ed61f53ecd4aefa4a83a5378901a8 (diff)
downloadsigen-cd9396d859cbba795c945796a6a0790a6c5c00a3.tar.gz
sigen-cd9396d859cbba795c945796a6a0790a6c5c00a3.tar.xz
sigen-cd9396d859cbba795c945796a6a0790a6c5c00a3.zip
Moved the sources into the Widgets namespace
Diffstat (limited to 'sigmodr/widgets/SoundUI.cpp')
-rw-r--r--sigmodr/widgets/SoundUI.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/sigmodr/widgets/SoundUI.cpp b/sigmodr/widgets/SoundUI.cpp
index d2c202cf..12330e04 100644
--- a/sigmodr/widgets/SoundUI.cpp
+++ b/sigmodr/widgets/SoundUI.cpp
@@ -36,7 +36,7 @@
#include <Phonon/AudioOutput>
#include <Phonon/MediaObject>
-Sigmodr::SoundUI::SoundUI(Sigmod::Sound* sound, QWidget* parent) :
+Sigmodr::Widgets::SoundUI::SoundUI(Sigmod::Sound* sound, QWidget* parent) :
ObjectUI(parent),
m_output(new Phonon::AudioOutput(Phonon::MusicCategory, this)),
m_media(new Phonon::MediaObject(this)),
@@ -46,13 +46,13 @@ Sigmodr::SoundUI::SoundUI(Sigmod::Sound* sound, QWidget* parent) :
setObjects(sound, new Sigmod::Sound(*sound));
}
-Sigmodr::SoundUI::~SoundUI()
+Sigmodr::Widgets::SoundUI::~SoundUI()
{
delete m_media;
delete m_buffer;
}
-void Sigmodr::SoundUI::initGui()
+void Sigmodr::Widgets::SoundUI::initGui()
{
Phonon::createPath(m_media, m_output);
m_media->setTickInterval(100);
@@ -69,37 +69,37 @@ void Sigmodr::SoundUI::initGui()
buttonBrowse->setIcon(KIcon("document-open"));
}
-void Sigmodr::SoundUI::refreshGui()
+void Sigmodr::Widgets::SoundUI::refreshGui()
{
resetAudioData();
}
-void Sigmodr::SoundUI::setGui()
+void Sigmodr::Widgets::SoundUI::setGui()
{
varName->setText(qobject_cast<Sigmod::Sound*>(modified())->name());
}
-void Sigmodr::SoundUI::apply()
+void Sigmodr::Widgets::SoundUI::apply()
{
*qobject_cast<Sigmod::Sound*>(original()) = *qobject_cast<Sigmod::Sound*>(modified());
emit(changed(false));
}
-void Sigmodr::SoundUI::discard()
+void Sigmodr::Widgets::SoundUI::discard()
{
*qobject_cast<Sigmod::Sound*>(modified()) = *qobject_cast<Sigmod::Sound*>(original());
setGui();
emit(changed(false));
}
-void Sigmodr::SoundUI::on_varName_textChanged(const QString& name)
+void Sigmodr::Widgets::SoundUI::on_varName_textChanged(const QString& name)
{
const int cursor = varName->cursorPosition();
qobject_cast<Sigmod::Sound*>(modified())->setName(name);
varName->setCursorPosition(cursor);
}
-void Sigmodr::SoundUI::on_buttonBrowse_clicked()
+void Sigmodr::Widgets::SoundUI::on_buttonBrowse_clicked()
{
QFile file(KFileDialog::getOpenFileName(KUrl("kfiledialog:///audio"), "audio/*|Audio files", this));
if (file.open(QIODevice::ReadOnly))
@@ -110,7 +110,7 @@ void Sigmodr::SoundUI::on_buttonBrowse_clicked()
}
}
-void Sigmodr::SoundUI::stateChanged(Phonon::State newState, Phonon::State oldState)
+void Sigmodr::Widgets::SoundUI::stateChanged(Phonon::State newState, Phonon::State oldState)
{
Q_UNUSED(oldState)
switch (newState)
@@ -142,7 +142,7 @@ void Sigmodr::SoundUI::stateChanged(Phonon::State newState, Phonon::State oldSta
}
}
-void Sigmodr::SoundUI::resetAudioData()
+void Sigmodr::Widgets::SoundUI::resetAudioData()
{
m_media->stop();
m_buffer->setData(qobject_cast<Sigmod::Sound*>(modified())->data());
@@ -150,7 +150,7 @@ void Sigmodr::SoundUI::resetAudioData()
tick(0);
}
-void Sigmodr::SoundUI::tick(qint64 time)
+void Sigmodr::Widgets::SoundUI::tick(qint64 time)
{
QTime currentTime(0, (time / 60000) % 60, (time / 1000) % 60, time % 1000);
qint64 total = m_media->totalTime();