/****************************************************************************
** Form implementation generated from reading ui file 'MainDialog.ui'
**
** Created: Tue Oct 1 22:28:37 2002
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "MainDialogData.h"

#include <qvariant.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlcdnumber.h>
#include <qslider.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

#include "widgets/PicButton.h"
#include "widgets/TimeLCD.h"
static const char* const image0_data[] = { 
"22 22 2 1",
". c None",
"# c #a4c610",
"........######........",
".....###########......",
"....##############....",
"...################...",
"..######......######..",
"..#####........#####..",
".#####.......#..#####.",
".####.......###..####.",
"####.......#####..####",
"####......#####...####",
"####....#######...####",
"####....######....####",
"####...########...####",
".####.##########..####",
".####..####.#########.",
".#####..##...########.",
"..#####.......#######.",
"..######......######..",
"...###################",
"....##################",
"......###########.###.",
"........######.....#.."};


/* 
 *  Constructs a MainDialogData which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 */
MainDialogData::MainDialogData( QWidget* parent,  const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    QPixmap image0( ( const char** ) image0_data );
    if ( !name )
	setName( "MainDialogData" );
    resize( 358, 222 ); 
    setCaption( trUtf8( "SIDPLAY" ) );

    timeLCD = new TimeLCD( this, "timeLCD" );
    timeLCD->setGeometry( QRect( 5, 35, 75, 30 ) ); 
    timeLCD->setMinimumSize( QSize( 75, 30 ) );
    QPalette pal;
    QColorGroup cg;
    cg.setColor( QColorGroup::Foreground, black );
    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
    cg.setColor( QColorGroup::Light, white );
    cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Text, black );
    cg.setColor( QColorGroup::BrightText, white );
    cg.setColor( QColorGroup::ButtonText, black );
    cg.setColor( QColorGroup::Base, white );
    cg.setColor( QColorGroup::Background, QColor( 152, 172, 160) );
    cg.setColor( QColorGroup::Shadow, black );
    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
    cg.setColor( QColorGroup::HighlightedText, white );
    cg.setColor( QColorGroup::Link, black );
    cg.setColor( QColorGroup::LinkVisited, black );
    pal.setActive( cg );
    cg.setColor( QColorGroup::Foreground, black );
    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
    cg.setColor( QColorGroup::Light, white );
    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Text, black );
    cg.setColor( QColorGroup::BrightText, white );
    cg.setColor( QColorGroup::ButtonText, black );
    cg.setColor( QColorGroup::Base, white );
    cg.setColor( QColorGroup::Background, QColor( 152, 172, 160) );
    cg.setColor( QColorGroup::Shadow, black );
    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
    cg.setColor( QColorGroup::HighlightedText, white );
    cg.setColor( QColorGroup::Link, black );
    cg.setColor( QColorGroup::LinkVisited, black );
    pal.setInactive( cg );
    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
    cg.setColor( QColorGroup::Light, white );
    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Text, black );
    cg.setColor( QColorGroup::BrightText, white );
    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Base, white );
    cg.setColor( QColorGroup::Background, QColor( 152, 172, 160) );
    cg.setColor( QColorGroup::Shadow, black );
    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
    cg.setColor( QColorGroup::HighlightedText, white );
    cg.setColor( QColorGroup::Link, black );
    cg.setColor( QColorGroup::LinkVisited, black );
    pal.setDisabled( cg );
    timeLCD->setPalette( pal );

    songLCD = new QLCDNumber( this, "songLCD" );
    songLCD->setGeometry( QRect( 90, 35, 40, 30 ) ); 
    songLCD->setMinimumSize( QSize( 40, 30 ) );
    cg.setColor( QColorGroup::Foreground, black );
    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
    cg.setColor( QColorGroup::Light, white );
    cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Text, black );
    cg.setColor( QColorGroup::BrightText, white );
    cg.setColor( QColorGroup::ButtonText, black );
    cg.setColor( QColorGroup::Base, white );
    cg.setColor( QColorGroup::Background, QColor( 152, 172, 166) );
    cg.setColor( QColorGroup::Shadow, black );
    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
    cg.setColor( QColorGroup::HighlightedText, white );
    cg.setColor( QColorGroup::Link, black );
    cg.setColor( QColorGroup::LinkVisited, black );
    pal.setActive( cg );
    cg.setColor( QColorGroup::Foreground, black );
    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
    cg.setColor( QColorGroup::Light, white );
    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Text, black );
    cg.setColor( QColorGroup::BrightText, white );
    cg.setColor( QColorGroup::ButtonText, black );
    cg.setColor( QColorGroup::Base, white );
    cg.setColor( QColorGroup::Background, QColor( 152, 172, 166) );
    cg.setColor( QColorGroup::Shadow, black );
    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
    cg.setColor( QColorGroup::HighlightedText, white );
    cg.setColor( QColorGroup::Link, black );
    cg.setColor( QColorGroup::LinkVisited, black );
    pal.setInactive( cg );
    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
    cg.setColor( QColorGroup::Light, white );
    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Text, black );
    cg.setColor( QColorGroup::BrightText, white );
    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
    cg.setColor( QColorGroup::Base, white );
    cg.setColor( QColorGroup::Background, QColor( 152, 172, 166) );
    cg.setColor( QColorGroup::Shadow, black );
    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
    cg.setColor( QColorGroup::HighlightedText, white );
    cg.setColor( QColorGroup::Link, black );
    cg.setColor( QColorGroup::LinkVisited, black );
    pal.setDisabled( cg );
    songLCD->setPalette( pal );
    songLCD->setFrameShape( QLCDNumber::Panel );
    songLCD->setFrameShadow( QLCDNumber::Sunken );
    songLCD->setNumDigits( 3 );
    songLCD->setSegmentStyle( QLCDNumber::Flat );
    QToolTip::add( songLCD, trUtf8( "Current song" ) );

    prevBtn = new PicButton( this, "prevBtn" );
    prevBtn->setGeometry( QRect( 142, 38, 36, 24 ) ); 
    prevBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, prevBtn->sizePolicy().hasHeightForWidth() ) );
    prevBtn->setMinimumSize( QSize( 36, 24 ) );
    prevBtn->setCursor( QCursor( 0 ) );
    QToolTip::add( prevBtn, trUtf8( "Previous Song" ) );

    stopBtn = new PicButton( this, "stopBtn" );
    stopBtn->setGeometry( QRect( 184, 38, 36, 24 ) ); 
    stopBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, stopBtn->sizePolicy().hasHeightForWidth() ) );
    stopBtn->setMinimumSize( QSize( 36, 24 ) );
    stopBtn->setCursor( QCursor( 0 ) );
    QToolTip::add( stopBtn, trUtf8( "Stop playing" ) );

    playBtn = new PicButton( this, "playBtn" );
    playBtn->setGeometry( QRect( 226, 38, 36, 24 ) ); 
    playBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, playBtn->sizePolicy().hasHeightForWidth() ) );
    playBtn->setMinimumSize( QSize( 36, 24 ) );
    playBtn->setCursor( QCursor( 0 ) );
    QToolTip::add( playBtn, trUtf8( "Play/Pause" ) );

    ffBtn = new PicButton( this, "ffBtn" );
    ffBtn->setGeometry( QRect( 268, 38, 36, 24 ) ); 
    ffBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, ffBtn->sizePolicy().hasHeightForWidth() ) );
    ffBtn->setMinimumSize( QSize( 36, 24 ) );
    ffBtn->setCursor( QCursor( 0 ) );
    QToolTip::add( ffBtn, trUtf8( "Fast forward" ) );

    nextBtn = new PicButton( this, "nextBtn" );
    nextBtn->setGeometry( QRect( 310, 38, 36, 24 ) ); 
    nextBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, nextBtn->sizePolicy().hasHeightForWidth() ) );
    nextBtn->setMinimumSize( QSize( 36, 24 ) );
    nextBtn->setCursor( QCursor( 0 ) );
    QToolTip::add( nextBtn, trUtf8( "Next song" ) );

    subSongSlider = new QSlider( this, "subSongSlider" );
    subSongSlider->setGeometry( QRect( 140, 65, 206, 12 ) ); 
    subSongSlider->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, subSongSlider->sizePolicy().hasHeightForWidth() ) );
    subSongSlider->setMaximumSize( QSize( 32767, 12 ) );
    subSongSlider->setCursor( QCursor( 0 ) );
    subSongSlider->setFocusPolicy( QSlider::TabFocus );
    subSongSlider->setMinValue( 1 );
    subSongSlider->setMaxValue( 1 );
    subSongSlider->setPageStep( 1 );
    subSongSlider->setValue( 1 );
    subSongSlider->setTracking( FALSE );
    subSongSlider->setOrientation( QSlider::Horizontal );
    QToolTip::add( subSongSlider, trUtf8( "Quick song selection" ) );

    playlistCheckBox = new QCheckBox( this, "playlistCheckBox" );
    playlistCheckBox->setGeometry( QRect( 15, 195, 120, 21 ) ); 
    QFont playlistCheckBox_font(  playlistCheckBox->font() );
    playlistCheckBox_font.setFamily( "Sans" );
    playlistCheckBox_font.setPointSize( 10 );
    playlistCheckBox->setFont( playlistCheckBox_font ); 
    playlistCheckBox->setText( trUtf8( "playlist enabled" ) );

    loopCheckBox = new QCheckBox( this, "loopCheckBox" );
    loopCheckBox->setGeometry( QRect( 140, 195, 100, 21 ) ); 
    QFont loopCheckBox_font(  loopCheckBox->font() );
    loopCheckBox_font.setFamily( "Sans" );
    loopCheckBox_font.setPointSize( 10 );
    loopCheckBox->setFont( loopCheckBox_font ); 
    loopCheckBox->setText( trUtf8( "loop playlist" ) );

    randomCheckBox = new QCheckBox( this, "randomCheckBox" );
    randomCheckBox->setGeometry( QRect( 245, 195, 101, 21 ) ); 
    QFont randomCheckBox_font(  randomCheckBox->font() );
    randomCheckBox_font.setFamily( "Sans" );
    randomCheckBox_font.setPointSize( 10 );
    randomCheckBox->setFont( randomCheckBox_font ); 
    randomCheckBox->setText( trUtf8( "random play" ) );

    infoField = new QLabel( this, "infoField" );
    infoField->setGeometry( QRect( 5, 80, 350, 110 ) ); 
    QFont infoField_font(  infoField->font() );
    infoField_font.setFamily( "fixed" );
    infoField->setFont( infoField_font ); 
    infoField->setFrameShape( QLabel::Panel );
    infoField->setFrameShadow( QLabel::Sunken );
    infoField->setLineWidth( 1 );
    infoField->setMargin( 1 );
    infoField->setText( trUtf8( "" ) );
    infoField->setTextFormat( QLabel::PlainText );
    infoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );

    // signals and slots connections
    connect( prevBtn, SIGNAL( pressed() ), this, SLOT( prevSongPressed() ) );
    connect( prevBtn, SIGNAL( released() ), this, SLOT( prevSongReleased() ) );
    connect( stopBtn, SIGNAL( pressed() ), this, SLOT( stopSongPressed() ) );
    connect( stopBtn, SIGNAL( released() ), this, SLOT( stopSongReleased() ) );
    connect( playBtn, SIGNAL( released() ), this, SLOT( playSongReleased() ) );
    connect( playBtn, SIGNAL( pressed() ), this, SLOT( playSongPressed() ) );
    connect( ffBtn, SIGNAL( pressed() ), this, SLOT( forwardSongPressed() ) );
    connect( ffBtn, SIGNAL( released() ), this, SLOT( forwardSongReleased() ) );
    connect( nextBtn, SIGNAL( pressed() ), this, SLOT( nextSongPressed() ) );
    connect( nextBtn, SIGNAL( released() ), this, SLOT( nextSongReleased() ) );
    connect( subSongSlider, SIGNAL( valueChanged(int) ), this, SLOT( newSubSong(int) ) );
    connect( subSongSlider, SIGNAL( sliderMoved(int) ), songLCD, SLOT( display(int) ) );
    connect( randomCheckBox, SIGNAL( toggled(bool) ), this, SLOT( setRandomPlayEnabled(bool) ) );
    connect( loopCheckBox, SIGNAL( toggled(bool) ), this, SLOT( setLoopPlayEnabled(bool) ) );
    connect( playlistCheckBox, SIGNAL( toggled(bool) ), this, SLOT( setPlaylistEnabled(bool) ) );

    // tab order
    setTabOrder( subSongSlider, playlistCheckBox );
    setTabOrder( playlistCheckBox, loopCheckBox );
    setTabOrder( loopCheckBox, randomCheckBox );
}

/*  
 *  Destroys the object and frees any allocated resources
 */
MainDialogData::~MainDialogData()
{
    // no need to delete child widgets, Qt does it all for us
}

void MainDialogData::forwardSongPressed()
{
    qWarning( "MainDialogData::forwardSongPressed(): Not implemented yet!" );
}

void MainDialogData::forwardSongReleased()
{
    qWarning( "MainDialogData::forwardSongReleased(): Not implemented yet!" );
}

void MainDialogData::newSubSong(int)
{
    qWarning( "MainDialogData::newSubSong(int): Not implemented yet!" );
}

void MainDialogData::setPlaylistEnabled(bool)
{
    qWarning( "MainDialogData::setPlaylistEnabled(bool): Not implemented yet!" );
}

void MainDialogData::nextSongPressed()
{
    qWarning( "MainDialogData::nextSongPressed(): Not implemented yet!" );
}

void MainDialogData::nextSongReleased()
{
    qWarning( "MainDialogData::nextSongReleased(): Not implemented yet!" );
}

void MainDialogData::playSongPressed()
{
    qWarning( "MainDialogData::playSongPressed(): Not implemented yet!" );
}

void MainDialogData::playSongReleased()
{
    qWarning( "MainDialogData::playSongReleased(): Not implemented yet!" );
}

void MainDialogData::prevSongPressed()
{
    qWarning( "MainDialogData::prevSongPressed(): Not implemented yet!" );
}

void MainDialogData::prevSongReleased()
{
    qWarning( "MainDialogData::prevSongReleased(): Not implemented yet!" );
}

void MainDialogData::setLoopPlayEnabled(bool)
{
    qWarning( "MainDialogData::setLoopPlayEnabled(bool): Not implemented yet!" );
}

void MainDialogData::setRandomPlayEnabled(bool)
{
    qWarning( "MainDialogData::setRandomPlayEnabled(bool): Not implemented yet!" );
}

void MainDialogData::stopSongPressed()
{
    qWarning( "MainDialogData::stopSongPressed(): Not implemented yet!" );
}

void MainDialogData::stopSongReleased()
{
    qWarning( "MainDialogData::stopSongReleased(): Not implemented yet!" );
}

