Skip to content
Snippets Groups Projects
Commit c17cffd6 authored by Gael Rial Costas's avatar Gael Rial Costas Committed by Felix de las Pozas
Browse files

Add Recorder

parent da937e96
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
#git_subproject(gmrvlex git@gitlab.vg-lab.es:nsviz/gmrvlex.git c20b194)
git_subproject(ShiFT https://github.com/vg-lab/shift ef486e96)
git_subproject(scoop https://github.com/vg-lab/scoop cc02a23)
git_subproject(acuterecorder https://github.com/vg-lab/AcuteRecorder.git 3fe7d5ba)
if(NEUROSCHEME_NSOL_ENABLED)
git_subproject(nsol https://github.com/vg-lab/nsol 872fe14f)
endif()
......@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
cmake_minimum_required( VERSION 3.1 FATAL_ERROR )
project( NeuroScheme VERSION 0.6.0 )
project( NeuroScheme VERSION 0.7.0 )
set( NeuroScheme_VERSION_ABI 12 )
# Disable in source building
......@@ -70,9 +70,10 @@ common_find_package( Lexis ${NEUROSCHEME_OPTS_FIND_ARGS} )
common_find_package( ZeroEQ ${NEUROSCHEME_OPTS_FIND_ARGS} )
common_find_package( Servus ${NEUROSCHEME_OPTS_FIND_ARGS} )
common_find_package( gmrvlex ${NEUROSCHEME_OPTS_FIND_ARGS} )
common_find_package( acuterecorder )
common_find_package_post( )
list( APPEND NEUROSCHEME_DEPENDENT_LIBRARIES ShiFT scoop Qt5Widgets )
list( APPEND NEUROSCHEME_DEPENDENT_LIBRARIES ShiFT scoop Qt5Widgets acuterecorder )
add_subdirectory( nslib )
add_subdirectory( nsplugins )
......
......@@ -2,6 +2,10 @@
## git master
## version 0.7
* [!109] Added a recorder option, which allows users to record the application.
## version 0.4
* [!106] Release 0.4 preparation.
......
......@@ -14,6 +14,7 @@ set( NEUROSCHEME_LINK_LIBRARIES
nslib
nslibcortex
nslibcongen
acuterecorder
)
include_directories(
......
......@@ -40,6 +40,8 @@
#include <zeroeq/version.h>
#endif
#include <acuterecorder/acuterecorder.h>
#include <QGridLayout>
#include <QPushButton>
#include <QInputDialog>
......@@ -52,6 +54,7 @@
MainWindow::MainWindow( QWidget* parent_, bool zeroEQ )
: QMainWindow( parent_ )
, _recorder( nullptr )
, minDockSizeX(305u)
, minDockSizeY(25u)
, _ui( new Ui::MainWindow )
......@@ -74,6 +77,9 @@ MainWindow::MainWindow( QWidget* parent_, bool zeroEQ )
connect( _ui->actionQuit, SIGNAL( triggered( )),
this, SLOT( close()));
connect( _ui->actionRecorder , SIGNAL( triggered( void )) ,
this ,SLOT( openRecorder( void )));
// ZeroEQ related actions ///////////////////////////////////////
#ifdef NEUROSCHEME_USE_ZEROEQ
_ui->actionToggleZeroEQ->setEnabled( true );
......@@ -774,3 +780,52 @@ void MainWindow::cleanScene( void )
auto &panes = nslib::PaneManager::panes();
std::for_each(panes.begin(), panes.end(), displayRoot);
}
void MainWindow::openRecorder( void )
{
// The button stops the recorder if found.
if( _recorder != nullptr )
{
_ui->actionRecorder->setDisabled( true );
_recorder->stop();
// Recorder will be deleted after finishing.
_recorder = nullptr;
_ui->actionRecorder->setChecked( false );
return;
}
RSWParameters params;
params.widgetsToRecord.emplace_back( "Main Widget" , this );
params.includeScreens = false;
if(!_ui->actionAdvancedRecorderOptions->isChecked())
{
params.showWorker = false;
params.showWidgetSourceMode = false;
params.showSourceParameters = false;
}
auto dialog = new RecorderDialog( nullptr , params , true );
dialog->setWindowIcon( QIcon( ":/visimpl.png" ));
dialog->setFixedSize( 800 , 600 );
if ( dialog->exec( ) == QDialog::Accepted)
{
_recorder = dialog->getRecorder( );
connect( _recorder , SIGNAL( finished( )) ,
_recorder , SLOT( deleteLater( )));
connect( _recorder , SIGNAL( finished( )) ,
this , SLOT( finishRecording( )));
_ui->actionRecorder->setChecked( true );
} else
{
_ui->actionRecorder->setChecked( false );
}
dialog->deleteLater( );
}
void MainWindow::finishRecording( )
{
_ui->actionRecorder->setEnabled( true );
}
\ No newline at end of file
......@@ -35,6 +35,8 @@ namespace Ui
class MainWindow;
}
class Recorder;
class StoredSelections
{
public:
......@@ -84,6 +86,12 @@ public slots:
void importFromJSON( void );
void cleanScene( void );
void openRecorder( void );
protected slots:
void finishRecording( );
protected:
enum TTableColumns
......@@ -102,6 +110,9 @@ protected:
QDockWidget* _connectionListDock = nullptr;
QString _lastOpenedFileName;
// Recorder
Recorder* _recorder;
private:
const unsigned int minDockSizeX;
const unsigned int minDockSizeY;
......
......@@ -61,6 +61,13 @@
<addaction name="actionFocusOnSelection"/>
<addaction name="actionAutoFocusOnSelection"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
<string>&amp;Tools</string>
</property>
<addaction name="actionRecorder"/>
<addaction name="actionAdvancedRecorderOptions"/>
</widget>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>&amp;File</string>
......@@ -76,6 +83,7 @@
<addaction name="menuPanes"/>
<addaction name="menuView"/>
<addaction name="menuEvents"/>
<addaction name="menuTools"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
......@@ -105,6 +113,8 @@
<addaction name="actionAutoFocusOnSelection"/>
<addaction name="actionFocusOnDisplayed"/>
<addaction name="actionAutoFocusOnDisplayed"/>
<addaction name="separator"/>
<addaction name="actionRecorder"/>
</widget>
<action name="actionLayouts">
<property name="checkable">
......@@ -384,6 +394,32 @@
<string>Export JSON</string>
</property>
</action>
<action name="actionRecorder">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/recorder.svg</normaloff>:/icons/recorder.svg</iconset>
</property>
<property name="text">
<string>Recorder</string>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
</property>
</action>
<action name="actionAdvancedRecorderOptions">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Advanced recorder options</string>
</property>
<property name="toolTip">
<string>Enable advanced recorder options</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="123.49702mm"
height="123.49702mm"
viewBox="0 0 123.49705 123.49705"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="recorder.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
fit-margin-top="15"
fit-margin-left="15"
fit-margin-right="15"
fit-margin-bottom="15"
lock-margins="false"
width="107.89702mm"
inkscape:zoom="0.74029882"
inkscape:cx="-127.65116"
inkscape:cy="226.93539"
inkscape:window-width="1920"
inkscape:window-height="1013"
inkscape:window-x="2560"
inkscape:window-y="1440"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2">
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Blur"
id="filter721"
x="-0.077007798"
y="-0.077007798"
width="1.1540156"
height="1.1540156">
<feGaussianBlur
stdDeviation="3 3"
result="blur"
id="feGaussianBlur719" />
</filter>
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-38.877594,-60.209427)">
<circle
style="fill:#2b0000;fill-rule:evenodd;stroke-width:0.264583;filter:url(#filter721)"
id="circle413"
cx="106.41572"
cy="129.05154"
r="46.748512"
transform="matrix(0.80142274,0,0,0.80142274,21.131741,25.626701)" />
<circle
style="fill:#aa0000;fill-rule:evenodd;stroke-width:0.212043"
id="path129"
cx="101.77579"
cy="123.36657"
r="37.465321" />
</g>
</svg>
......@@ -28,5 +28,6 @@
<file>icons/horizontalSplit.svg</file>
<file>icons/verticalSplit.svg</file>
<file>icons/documentClose.svg</file>
<file>icons/recorder.svg</file>
</qresource>
</RCC>
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