Skip to content

Commit

Permalink
[crop] Allow to hide the rubber band
Browse files Browse the repository at this point in the history
  • Loading branch information
eumagga0x2a committed Aug 25, 2017
1 parent dec94a1 commit 8f2c51e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions avidemux_plugins/ADM_videoFilters6/crop/crop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ uint32_t:top
uint32_t:bottom
uint32_t:left
uint32_t:right
bool:rubber_is_hidden
}
7 changes: 3 additions & 4 deletions avidemux_plugins/ADM_videoFilters6/crop/crop.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// automatically generated by admSerialization.py, do not edit!
// automatically generated by admSerialization.py do not edit
#ifndef ADM_crop_CONF_H
#define ADM_crop_CONF_H
#include "string"
#pragma once
typedef struct {
uint32_t top;
uint32_t bottom;
uint32_t left;
uint32_t right;
bool rubber_is_hidden;
}crop;
#endif
4 changes: 3 additions & 1 deletion avidemux_plugins/ADM_videoFilters6/crop/crop_desc.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const ADM_paramList crop_param[]={
// automatically generated by admSerialization.py, do not edit!
extern const ADM_paramList crop_param[]={
{"top",offsetof(crop,top),"uint32_t",ADM_param_uint32_t},
{"bottom",offsetof(crop,bottom),"uint32_t",ADM_param_uint32_t},
{"left",offsetof(crop,left),"uint32_t",ADM_param_uint32_t},
{"right",offsetof(crop,right),"uint32_t",ADM_param_uint32_t},
{"rubber_is_hidden",offsetof(crop,rubber_is_hidden),"bool",ADM_param_bool},
{NULL,0,NULL}
};
19 changes: 18 additions & 1 deletion avidemux_plugins/ADM_videoFilters6/crop/qt5/DIA_flyCrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,17 @@ uint32_t width,height;
myCrop->right=param->right;
myCrop->top=param->top;
myCrop->bottom=param->bottom;
myCrop->rubber_is_hidden=param->rubber_is_hidden;
myCrop->_cookie=&ui;
myCrop->addControl(ui.toolboxLayout);
myCrop->upload(false,true);
myCrop->sliderChanged();

ui.checkBoxRubber->setChecked(myCrop->rubber_is_hidden);
myCrop->rubber->setVisible(!(myCrop->rubber_is_hidden));

connect( ui.horizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(sliderUpdate(int)));
connect( ui.checkBoxRubber,SIGNAL(stateChanged(int)),this,SLOT(toggleRubber(int)));
connect( ui.pushButtonAutoCrop,SIGNAL(clicked(bool)),this,SLOT(autoCrop(bool)));
connect( ui.pushButtonReset,SIGNAL(clicked(bool)),this,SLOT(reset(bool)));
#define SPINNER(x) connect( ui.spinBox##x,SIGNAL(valueChanged(int)),this,SLOT(valueChanged(int)));
Expand Down Expand Up @@ -388,7 +393,8 @@ void Ui_cropWindow::gather(crop *param)
param->right=myCrop->right;
param->top=myCrop->top;
param->bottom=myCrop->bottom;
}
param->rubber_is_hidden=myCrop->rubber_is_hidden;
}
/**
*
*/
Expand All @@ -413,6 +419,17 @@ void Ui_cropWindow::valueChanged( int f )
myCrop->rubber->nestedIgnore--;
lock--;
}
/**
* \fn toggleRubber
*/
void Ui_cropWindow::toggleRubber(int checkState)
{
bool visible=true;
if(checkState)
visible=false;
myCrop->rubber->setVisible(visible);
myCrop->rubber_is_hidden=!visible;
}
/**
*
* @param f
Expand Down
1 change: 1 addition & 0 deletions avidemux_plugins/ADM_videoFilters6/crop/qt5/DIA_flyCrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class flyCrop : public ADM_flyDialogRgb
friend class Ui_cropWindow;
public:
uint32_t left,right,top,bottom;
bool rubber_is_hidden;
public:
uint8_t processRgb(uint8_t *imageIn, uint8_t *imageOut);
uint8_t download(void);
Expand Down
1 change: 1 addition & 0 deletions avidemux_plugins/ADM_videoFilters6/crop/qt5/Q_crop.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ private slots:
void valueChanged(int foo);
void autoCrop(bool f);
void reset(bool f);
void toggleRubber(int checkState);

private:
void resizeEvent(QResizeEvent *event);
Expand Down
11 changes: 11 additions & 0 deletions avidemux_plugins/ADM_videoFilters6/crop/qt5/crop.ui
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@
</property>
</spacer>
</item>
<item row="1" column="6">
<widget class="QCheckBox" name="checkBoxRubber">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Hide Rubber Band</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -226,6 +236,7 @@
<tabstop>spinBoxRight</tabstop>
<tabstop>spinBoxTop</tabstop>
<tabstop>spinBoxBottom</tabstop>
<tabstop>checkBoxRubber</tabstop>
<tabstop>pushButtonAutoCrop</tabstop>
<tabstop>pushButtonReset</tabstop>
<tabstop>horizontalSlider</tabstop>
Expand Down

0 comments on commit 8f2c51e

Please sign in to comment.