1 // andrea diamantini - adjam7@gmail.com
2 // musik - simplest KDE4 audio player
8 MusikEdit::MusikEdit(Phonon::MediaObject
& mo
)
13 connect( okButton
, SIGNAL( clicked() ), this , SLOT( ok() ) );
14 connect( clearButton
, SIGNAL( clicked() ), this , SLOT( clear() ) );
15 connect( cancelButton
, SIGNAL( clicked() ), this , SLOT( cancel() ) );
20 MusikEdit::~MusikEdit()
24 void MusikEdit::setupUi()
26 QLabel
*artistLabel
= new QLabel( tr("artist") );
27 QLabel
*albumLabel
= new QLabel( tr("album") );
28 QLabel
*titleLabel
= new QLabel( tr("title") );
29 QLabel
*dateLabel
= new QLabel( tr("date") );
30 QLabel
*genreLabel
= new QLabel( tr("genre") );
31 QLabel
*trackNumberLabel
= new QLabel( tr("track number") );
32 QLabel
*descLabel
= new QLabel( tr("description") );
34 QVBoxLayout
*labelLayout
= new QVBoxLayout
;
35 labelLayout
->addWidget(artistLabel
);
36 labelLayout
->addWidget(albumLabel
);
37 labelLayout
->addWidget(titleLabel
);
38 labelLayout
->addWidget(dateLabel
);
39 labelLayout
->addWidget(genreLabel
);
40 labelLayout
->addWidget(trackNumberLabel
);
41 labelLayout
->addWidget(descLabel
);
43 artistLine
= new QLineEdit();
44 albumLine
= new QLineEdit();
45 titleLine
= new QLineEdit();
46 dateLine
= new QLineEdit();
47 genreLine
= new QLineEdit();
48 trackNumberLine
= new QLineEdit();
49 descLine
= new QLineEdit();
51 QVBoxLayout
*lineLayout
= new QVBoxLayout
;
52 lineLayout
->addWidget(artistLine
);
53 lineLayout
->addWidget(albumLine
);
54 lineLayout
->addWidget(titleLine
);
55 lineLayout
->addWidget(dateLine
);
56 lineLayout
->addWidget(genreLine
);
57 lineLayout
->addWidget(trackNumberLine
);
58 lineLayout
->addWidget(descLine
);
61 okButton
= new QPushButton( tr("ok") );
62 clearButton
= new QPushButton( tr("clear") );
63 cancelButton
= new QPushButton( tr("cancel") );
64 QHBoxLayout
*buttonLayout
= new QHBoxLayout
;
65 buttonLayout
->addWidget(okButton
);
66 buttonLayout
->addWidget(clearButton
);
67 buttonLayout
->addWidget(cancelButton
);
69 QHBoxLayout
*infoLayout
= new QHBoxLayout
;
70 infoLayout
->addLayout(labelLayout
);
71 infoLayout
->addLayout(lineLayout
);
73 QVBoxLayout
*mainLayout
= new QVBoxLayout
;
74 mainLayout
->addLayout(infoLayout
);
75 mainLayout
->addLayout(buttonLayout
);
77 setLayout(mainLayout
);
78 setWindowTitle("Musik Tag Editor");
82 void MusikEdit::setSongInfo(Phonon::MediaObject
& mo
)
84 artistLine
->setText( mo
.metaData(Phonon::ArtistMetaData
).at(0) );
85 albumLine
->setText( mo
.metaData(Phonon::AlbumMetaData
).at(0) );
86 titleLine
->setText( mo
.metaData(Phonon::TitleMetaData
).at(0) );
87 dateLine
->setText( mo
.metaData(Phonon::DateMetaData
).at(0) );
88 // genreLine->setText( mo.metaData(Phonon::GenreMetaData).at(0) ); // FIXME phonon problem: to investigate..
89 trackNumberLine
->setText( mo
.metaData(Phonon::TracknumberMetaData
).at(0) );
90 descLine
->setText( mo
.metaData(Phonon::DescriptionMetaData
).at(0) );
100 void MusikEdit::clear()
107 trackNumberLine
->clear();
112 void MusikEdit::cancel()