many many things
This commit is contained in:
@@ -140,7 +140,6 @@ Media* Project::import_file(QString file) {
|
||||
} else {
|
||||
MediaStream* ms = new MediaStream();
|
||||
ms->preview_done = false;
|
||||
ms->preview_lock.lock();
|
||||
ms->file_index = i;
|
||||
if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||
bool infinite_length = (pFormatCtx->streams[i]->avg_frame_rate.den == 0);
|
||||
|
||||
+47
-57
@@ -55,6 +55,7 @@ Timeline::Timeline(QWidget *parent) :
|
||||
tool_buttons.append(ui->toolRazorButton);
|
||||
tool_buttons.append(ui->toolSlipButton);
|
||||
tool_buttons.append(ui->toolRollingButton);
|
||||
tool_buttons.append(ui->toolSlideButton);
|
||||
|
||||
ui->toolArrowButton->click();
|
||||
|
||||
@@ -383,36 +384,7 @@ void Timeline::ripple(long ripple_point, long ripple_length) {
|
||||
|
||||
void Timeline::decheck_tool_buttons(QObject* sender) {
|
||||
for (int i=0;i<tool_buttons.count();i++) {
|
||||
if (tool_buttons[i] != sender) {
|
||||
tool_buttons[i]->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_toolEditButton_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::IBeamCursor);
|
||||
tool = TIMELINE_TOOL_EDIT;
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_toolArrowButton_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_POINTER;
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_toolRazorButton_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::IBeamCursor);
|
||||
tool = TIMELINE_TOOL_RAZOR;
|
||||
tool_buttons[i]->setChecked(tool_buttons.at(i) == sender);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,33 +408,6 @@ bool Timeline::is_clip_selected(Clip* clip) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Timeline::on_toolRippleButton_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_RIPPLE;
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_toolRollingButton_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_ROLLING;
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_toolSlipButton_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_SLIP;
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_snappingButton_toggled(bool checked)
|
||||
{
|
||||
snapping = checked;
|
||||
@@ -849,3 +794,48 @@ long Timeline::getFrameFromScreenPoint(int x) {
|
||||
int Timeline::getScreenPointFromFrame(long frame) {
|
||||
return (int) round(frame*zoom);
|
||||
}
|
||||
|
||||
void Timeline::on_toolArrowButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_POINTER;
|
||||
}
|
||||
|
||||
void Timeline::on_toolEditButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::IBeamCursor);
|
||||
tool = TIMELINE_TOOL_EDIT;
|
||||
}
|
||||
|
||||
void Timeline::on_toolRippleButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_RIPPLE;
|
||||
}
|
||||
|
||||
void Timeline::on_toolRollingButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_ROLLING;
|
||||
}
|
||||
|
||||
void Timeline::on_toolRazorButton_clicked()
|
||||
{
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::IBeamCursor);
|
||||
tool = TIMELINE_TOOL_RAZOR;
|
||||
}
|
||||
|
||||
void Timeline::on_toolSlipButton_clicked()
|
||||
{
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_SLIP;
|
||||
}
|
||||
|
||||
void Timeline::on_toolSlideButton_clicked()
|
||||
{
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_SLIDE;
|
||||
}
|
||||
|
||||
+16
-12
@@ -35,6 +35,7 @@ struct Ghost {
|
||||
long ghost_length;
|
||||
long media_length;
|
||||
bool trim_in;
|
||||
bool trimming;
|
||||
};
|
||||
|
||||
struct Selection {
|
||||
@@ -164,24 +165,27 @@ public slots:
|
||||
void repaint_timeline();
|
||||
|
||||
private slots:
|
||||
void on_toolEditButton_toggled(bool checked);
|
||||
|
||||
void on_toolArrowButton_toggled(bool checked);
|
||||
|
||||
void on_toolRazorButton_toggled(bool checked);
|
||||
|
||||
void on_pushButton_4_clicked();
|
||||
|
||||
void on_pushButton_5_clicked();
|
||||
|
||||
void on_toolRippleButton_toggled(bool checked);
|
||||
|
||||
void on_toolRollingButton_toggled(bool checked);
|
||||
|
||||
void on_toolSlipButton_toggled(bool checked);
|
||||
void on_pushButton_5_clicked();
|
||||
|
||||
void on_snappingButton_toggled(bool checked);
|
||||
|
||||
void on_toolSlideButton_clicked();
|
||||
|
||||
void on_toolArrowButton_clicked();
|
||||
|
||||
void on_toolEditButton_clicked();
|
||||
|
||||
void on_toolRippleButton_clicked();
|
||||
|
||||
void on_toolRollingButton_clicked();
|
||||
|
||||
void on_toolRazorButton_clicked();
|
||||
|
||||
void on_toolSlipButton_clicked();
|
||||
|
||||
private:
|
||||
QVector<QPushButton*> tool_buttons;
|
||||
void decheck_tool_buttons(QObject* sender);
|
||||
|
||||
+34
-3
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>523</width>
|
||||
<height>363</height>
|
||||
<height>376</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -233,7 +233,38 @@
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/slip.png</normalon>
|
||||
<disabledoff>:/icons/slip-disabled.png</disabledoff>
|
||||
<disabledon>:/icons/slip-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolSlideButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Slide Tool (U)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/slide.png</normalon>
|
||||
<disabledon>:/icons/slide-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
@@ -331,7 +362,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>408</width>
|
||||
<height>314</height>
|
||||
<height>327</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
|
||||
Reference in New Issue
Block a user