1
/***************************************************************************
2
clippropertiesdialog.cpp - description
4
begin : Mon Mar 17 2003
5
copyright : (C) 2003 by Jason Wood
6
email : jasonwood@blueyonder.co.uk
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
21
#include <qnamespace.h>
22
#include <qhgroupbox.h>
25
#include "clippropertiesdialog.h"
26
#include "docclipavfile.h"
27
#include "docclipref.h"
31
ClipPropertiesDialog::ClipPropertiesDialog(QWidget * parent,
32
const char *name):QVBox(parent, name), m_clip(0) {
34
QHGroupBox *m_videoGBox =
35
new QHGroupBox(i18n("Video Stream"), this, "videoStream");
36
m_videoGBox->setAlignment(0);
37
m_videoGBox->setOrientation(Horizontal);
38
m_videoGBox->setInsideSpacing(3);
39
QHBox *m_videoHBox = new QHBox(m_videoGBox);
40
QVBox *m_videoVBoxL = new QVBox(m_videoHBox);
41
QVBox *m_videoVBoxR = new QVBox(m_videoHBox);
42
//video stream headers
43
new QLabel(i18n("Filename:"), m_videoVBoxL);
44
new QLabel(i18n("Frame size, (fps):"), m_videoVBoxL);
45
new QLabel(i18n("Length (hh:mm:ss):"), m_videoVBoxL);
46
new QLabel(i18n("System:"), m_videoVBoxL);
47
new QLabel(i18n("Decompressor:"), m_videoVBoxL);
48
//video stream info data
49
filenameLabel = new QLabel(m_videoVBoxR);
50
filenameLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
51
frameSizeLabel = new QLabel(m_videoVBoxR);
52
frameSizeLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
53
videoLength = new QLabel(m_videoVBoxR);
54
videoLength->setFrameStyle(QFrame::Panel | QFrame::Sunken);
55
systemLabel = new QLabel(m_videoVBoxR);
56
systemLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
57
decompressorLabel = new QLabel(m_videoVBoxR);
58
decompressorLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
61
QHGroupBox *m_audioGBox =
62
new QHGroupBox(i18n("Audio Stream"), this, "audioStream");
63
m_audioGBox->setAlignment(0);
64
m_audioGBox->setOrientation(Horizontal);
65
m_audioGBox->setInsideSpacing(3);
66
QHBox *m_audioHBox = new QHBox(m_audioGBox);
67
QVBox *m_audioVBoxL = new QVBox(m_audioHBox);
68
QVBox *m_audioVBoxR = new QVBox(m_audioHBox);
69
//audio stream headers
70
new QLabel(i18n("Sampling Rate:"), m_audioVBoxL);
71
new QLabel(i18n("Channels:"), m_audioVBoxL);
72
new QLabel(i18n("Format:"), m_audioVBoxL);
73
new QLabel(i18n("Bits per Sample:"), m_audioVBoxL);
74
//audio stream info data
75
samplingRateLabel = new QLabel(m_audioVBoxR);
76
samplingRateLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
77
channelsLabel = new QLabel(m_audioVBoxR);
78
channelsLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
79
formatLabel = new QLabel(m_audioVBoxR);
80
formatLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
81
audiobitLabel = new QLabel(m_audioVBoxR);
82
audiobitLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
83
} ClipPropertiesDialog::~ClipPropertiesDialog() {
86
//display properties based on selected clip
87
void ClipPropertiesDialog::setClip(DocClipRef * clip) {
91
filenameLabel->setText(m_clip->name());
92
if (m_clip->clipWidth()!=0 && m_clip->clipHeight()!=0)
93
frameSizeLabel->setText(i18n("%1x%2, %3 fps").arg(m_clip->
94
clipWidth()).arg(clip->clipHeight()).arg(m_clip->
96
else frameSizeLabel->setText(i18n("Unknown size, %1 fps").arg(m_clip->framesPerSecond()));
97
if (m_clip->durationKnown()) {
99
int seconds = (int) m_clip->duration().seconds() % 60;
101
(int) floor(m_clip->duration().seconds() / 60);
102
int hours = (int) floor(minutes / 60);
104
minutes = (int) hours % 60;
108
length.append(QString::number(hours).rightJustify(1, '0',
111
length.append(QString::number(minutes).rightJustify(2, '0',
114
length.append(QString::number(seconds).rightJustify(2, '0',
116
videoLength->setText(length);
118
videoLength->setText(i18n("unknown"));
120
systemLabel->setText(m_clip->avSystem());
121
decompressorLabel->setText(m_clip->avDecompressor());
124
samplingRateLabel->setText(i18n("0Hz"));
125
switch (m_clip->audioChannels()) {
127
channelsLabel->setText(i18n("%1 (stereo)").arg(m_clip->
131
channelsLabel->setText(i18n("%1 (mono)").arg(m_clip->
135
channelsLabel->setText(QString::number(m_clip->
139
formatLabel->setText(m_clip->audioFormat());
140
audiobitLabel->setText(i18n("%1 bit").arg(m_clip->