Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Add track: add possibility to create AV track and Audio rec track

parent 7a65673b
Pipeline #1729 passed with stage
in 15 minutes and 48 seconds
......@@ -94,9 +94,19 @@ int TrackDialog::selectedTrackId() const
return -1;
}
bool TrackDialog::addAVTrack() const
{
return av_track->isChecked();
}
bool TrackDialog::addRecTrack() const
{
return arec_track->isChecked();
}
bool TrackDialog::addAudioTrack() const
{
return !video_track->isChecked();
return audio_track->isChecked() || arec_track->isChecked();
}
const QString TrackDialog::trackName() const
{
......
......@@ -39,6 +39,12 @@ public:
/** @brief: returns true if we want to insert an audio track
*/
bool addAudioTrack() const;
/** @brief: returns true if we want to insert an audio record track
*/
bool addRecTrack() const;
/** @brief: returns true if we want to insert an audio and video track
*/
bool addAVTrack() const;
/** @brief: returns the newly created track name
*/
const QString trackName() const;
......
......@@ -470,9 +470,23 @@ void TimelineController::addTrack(int tid)
QPointer<TrackDialog> d = new TrackDialog(m_model, tid, qApp->activeWindow());
if (d->exec() == QDialog::Accepted) {
int newTid;
bool audioRecTrack = d->addRecTrack();
bool addAVTrack = d->addAVTrack();
m_model->requestTrackInsertion(d->selectedTrackPosition(), newTid, d->trackName(), d->addAudioTrack());
if (addAVTrack) {
int newTid2;
int mirrorPos = 0;
int mirrorId = m_model->getMirrorAudioTrackId(newTid);
if (mirrorId > -1) {
mirrorPos = m_model->getTrackMltIndex(mirrorId);
}
m_model->requestTrackInsertion(mirrorPos, newTid2, d->trackName(), true);
}
m_model->buildTrackCompositing(true);
m_model->_resetView();
if (audioRecTrack) {
m_model->setTrackProperty(newTid, "kdenlive:audio_rec", QStringLiteral("1"));
}
}
}
......
......@@ -6,28 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>430</width>
<height>208</height>
<width>496</width>
<height>168</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Insert track</string>
</property>
</spacer>
</widget>
</item>
<item row="0" column="1" colspan="2">
<item row="0" column="1">
<widget class="KComboBox" name="before_select">
<item>
<property name="text">
......@@ -41,39 +35,56 @@
</item>
</widget>
</item>
<item row="4" column="1" colspan="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QRadioButton" name="video_track">
<property name="text">
<string>Video &amp;track</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Insert track</string>
</property>
</widget>
<item row="0" column="2">
<widget class="KComboBox" name="comboTracks"/>
</item>
<item row="1" column="2" colspan="2">
<widget class="QRadioButton" name="audio_track">
<property name="text">
<string>A&amp;udio track</string>
</property>
</widget>
<item row="1" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="video_track">
<property name="text">
<string>Video &amp;track</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="audio_track">
<property name="text">
<string>A&amp;udio track</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="av_track">
<property name="text">
<string>AV track</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="arec_track">
<property name="text">
<string>Au&amp;dio record track</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="name_label">
......@@ -82,24 +93,31 @@
</property>
</widget>
</item>
<item row="2" column="1" colspan="4">
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="track_name"/>
</item>
<item row="1" column="4">
<spacer name="horizontalSpacer">
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3" colspan="2">
<widget class="KComboBox" name="comboTracks"/>
<item row="3" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment