/***************************************************************************
 *   Copyright (C) 2007 by Andreas Krumnow   *
 *   andreas@krumnow.de   *
 *                                                                         *
 *   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 2 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, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/


#ifndef METRONOM_H
#define METRONOM_H

#include <QApplication>
#include <QWidget>
#include <QGridLayout>
#include <QPushButton>
#include <QSlider>
#include <QSpinBox>
#include <QCheckBox>
#include <QLabel>
#include <QFont>

#include "zeigerfeld.h"
#include "audiothread.h"

class metronom:public QWidget
{
      Q_OBJECT

private:
    QPushButton *quitButton, *runButton, *resetButton ;
    QSlider     *sld_sWidth, *sld_tempo;
    QCheckBox   *cbx_zeiger, *cbx_click;
    QSpinBox    *spx_takt;
    QLabel      *lbl_beat, *lbl_sWidth, *lbl_tempo, *lbl_temp1,
                *lbl_dbgln, *lbl_zeiger, *lbl_click, *lbl_takt;
    QGridLayout *gridLayout;
    ZeigerFeld  *pendel;
    audioThread *speaker;
    bool        is_running, click_on, zeiger_on;
    int         tempo, taktZ, taktT, curCount, currentAngleWidth;
    QTimer      *pulse;
    QString     dbg_txt;

public:
      metronom();
      ~metronom();

private slots:
    void on_runButton();
    void on_sld_sWidth(int i);
    void on_sld_tempo(int i);
    void on_cbx_zeiger(int qtcs);
    void on_cbx_click(int qtcs);
    void on_spx_takt(int i);
    void playTick();
};

#endif