imama problem sa phonon
Starting /home/stefan/QTProjects/STick/STick-build-desktop/STick...
WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface
jackd 0.118.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
could not open driver .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
JACK compiled with System V SHM support.
loading driver ..
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
the playback device "hw:0" is already in use. Please stop the application using it and run JACK again
cannot load driver module alsa
sve sto saM URADIO JE .
mainwindow.cpp
Code:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QSound>
#include <phonon/MediaObject>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
ui->pushButton_2->setEnabled(true);
ui->pushButton->setEnabled(false);
ui->label->setEnabled(false);
ui->spinBox->setEnabled(false);
connect(&timer, SIGNAL(timeout()), this, SLOT(tick()));
timer.start(60000/ui->spinBox->value());
}
void MainWindow::tick()
{
Phonon::MediaObject *m = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("/home/stefan/Tick.wav"));
m->play();
m->stop();
}
void MainWindow::on_pushButton_2_clicked()
{
timer.stop();
ui->label->setEnabled(true);
ui->spinBox->setEnabled(true);
ui->pushButton->setEnabled(true);
ui->pushButton_2->setEnabled(false);
}
mainwindow.h
Code:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
QTimer timer;
private:
Ui::MainWindow *ui;
private slots:
void on_pushButton_2_clicked();
void on_pushButton_clicked();
void tick();
};
#endif // MAINWINDOW_H
Problem je taj sto kad kliknem na pushbutton odsfira samo jednom a treba sve dok ne kazem stop klikom na pushbutton_2
zvuk je samo ton C cetvrtina u taktu 1/4
sta da radim