Skip to content

Commit

Permalink
Added sub-project to realize a tutorial to activate a new audio node
Browse files Browse the repository at this point in the history
  • Loading branch information
hkhauke committed Feb 19, 2024
1 parent fafa73d commit 2cce0fc
Show file tree
Hide file tree
Showing 209 changed files with 8,070 additions and 0 deletions.
Empty file.
Empty file.
37 changes: 37 additions & 0 deletions sources/sub-projects/ayfstarter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
if(NOT JVX_USES_SDK)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/paths.local.cmake)
include(${JVX_BASE_CMAKE_DIR}/paths.cmake)
include(${JVX_SUBPRODUCT_CMAKE_DIR}/paths.${JVX_PRODUCT}.cmake)
else()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/paths.sdk.local.cmake)
include(${JVX_BASE_ROOT}/cmake/cmake-sdk/paths.sdk.cmake)
include(${JVX_SUBPRODUCT_ROOT}/cmake/cmake-sdk/paths.sdk.${JVX_PRODUCT}.cmake)
endif()

set(AYF_STARTER_STATIC_LIBS
${CMAKE_CURRENT_SOURCE_DIR}/sources/Libraries/ayfstarterlib
)
jvx_addSubdirs("Configuring static library for ayfstarter core functionality" "${AYF_STARTER_STATIC_LIBS}" "${JVX_FOLDER_HIERARCHIE_BASE}/Library")

set(AYF_STARTER_AUDIONODE
${CMAKE_CURRENT_SOURCE_DIR}/sources/Components/AudioNodes/ayfAuNStarter
)
jvx_addSubdirs("Configuring shared library for ayfstarter audio node" "${AYF_STARTER_AUDIONODE}" "${JVX_FOLDER_HIERARCHIE_BASE}/AudioNode")

if(NOT JVX_RELEASE_SDK)
set(AYF_STARTER_APPLICATION "")
if(JVX_USE_PART_WEBSERVER)

set(AYF_STARTER_APPLICATION ${AYF_STARTER_APPLICATION}
${CMAKE_CURRENT_SOURCE_DIR}/sources/Applications/ayfstarter-web)

endif()

if(JVX_USE_QT)

set(AYF_STARTER_APPLICATION ${AYF_STARTER_APPLICATION}
${CMAKE_CURRENT_SOURCE_DIR}/sources/Applications/ayfstarter-qt)

endif()
jvx_addSubdirs("Configuring application ayfstarter " "${AYF_STARTER_APPLICATION}" "${JVX_FOLDER_HIERARCHIE_BASE}/Application")
endif()
3 changes: 3 additions & 0 deletions sources/sub-projects/ayfstarter/cmake/paths.local.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(SUBPRODUCT_AYFSTARTER_LIBS_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sources/Libraries")
set(SUBPRODUCT_AYFSTARTER_LIBS_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sources/Libraries")
set(SUBPRODUCT_AYFSTARTER_LIBS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Some common include files
set(PROJECT_NAME ayfstarterQt)
include(${JVX_CMAKE_DIR}/common_local_head.cmake)

# Decide which host library to link with
set(JVX_LINK_WITH_AUDIO_HOST TRUE)

# Add mainWidget and other ui files
#set(LOCAL_UI_SOURCES
# ${CMAKE_CURRENT_SOURCE_DIR}/uisrc/myMainWidget.ui
# )
set(LOCAL_UI_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/uisrc)

# Qt resource file add
set(LOCAL_QT_RESOURCES
${CMAKE_CURRENT_SOURCE_DIR}/uisrc/ayfStarter.qrc
)

# Source code files
set(LOCAL_SOURCES

${CMAKE_CURRENT_SOURCE_DIR}/../common/ayfstarter-components.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ayfstarter-connectionrules.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ayfstarter-hostconfig.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ayfstarter-sequencer.cpp

${CMAKE_CURRENT_SOURCE_DIR}/src/jvxAudioHost_hooks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/myCentralWidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/myCentralWidget.h
)

# Some required include paths
include_directories(
${SUBPRODUCT_AYFSTARTER_LIBS_BINARY_DIR}/sources/Components/AudioNodes/ayfAuNStarter/
${JVX_BASE_ROOT}/sources/jvxLibraries/jvx-component-templates-base/include
${JVX_BASE_ROOT}/sources/jvxLibraries/jvx-component-templates-product/include
${JVX_BASE_ROOT}/sources/jvxLibraries/jvx-qt-app-templates/src
${CMAKE_CURRENT_SOURCE_DIR}/src
)

# Add algorithm specific library
set(LOCAL_LIBS
ayfAuNStarter_static
jvx-qt-app-templates_static
)

# Link against either audio host lib or develop host lib
include(${JVX_SUBPRODUCT_ROOT}/cmake/hostlink.audio.cmake)

## ======================================================================
## The audio libs
# Pull in all audio components
include(${JVX_CMAKE_DIR}/packages/cmake-audio-components.cmake)

## ======================================================================
## Prepare the QT workspace settings in VS
set(JVX_PREPARE_QT_WORKSPACE_VS TRUE)

# Some compile defines
set(LOCAL_COMPILE_DEFINITIONS "${LOCAL_COMPILE_DEFINITIONS};JVX_PROJECT_NAMESPACE=AYF_STARTER_QT")

# Macos x specific configurations
if(JVX_OS MATCHES "macosx")
set(JVX_MAC_OS_CREATE_BUNDLE TRUE)
else(JVX_OS MATCHES "macosx")
set(CONFIGURE_LOCAL_START_SCRIPT TRUE)
endif(JVX_OS MATCHES "macosx")

# Some common include files
include(${JVX_CMAKE_DIR}/common_local_exe_foot.cmake)
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include "jvx.h"

// =============================================================
// Configure ui extensions
// =============================================================
JVX_INTERFACE IjvxQtComponentWidget;
jvxErrorType
IjvxQtComponentWidget_init(IjvxQtComponentWidget** onReturn, jvxBitField featureClass, const jvxComponentIdentification& cpId)
{
if (onReturn)
*onReturn = NULL;
return JVX_ERROR_UNSUPPORTED;
}

jvxErrorType
IjvxQtComponentWidget_terminate(IjvxQtComponentWidget* returnMe, jvxBitField featureClass, const jvxComponentIdentification& cpId)
{
assert(returnMe == NULL);
return JVX_ERROR_UNSUPPORTED;
}

// =======================================================================


#include "myCentralWidget.h"

// =============================================================
// Main widget entry functions
// =============================================================
jvxErrorType
mainWindow_UiExtension_host_init(mainWindow_UiExtension_host** onReturn, QWidget* parent)
{
#ifdef JVX_PROJECT_NAMESPACE
JVX_PROJECT_NAMESPACE::myCentralWidget* elm = new JVX_PROJECT_NAMESPACE::myCentralWidget(parent);
#else
myCentralWidget* elm = new myCentralWidget(parent);
#endif
if (onReturn)
{
*onReturn = static_cast<mainWindow_UiExtension_host*>(elm);
}
return JVX_NO_ERROR;
}

jvxErrorType
mainWindow_UiExtension_host_terminate(mainWindow_UiExtension_host* elm)
{
delete(elm);
return JVX_NO_ERROR;
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#include "myCentralWidget.h"

#ifdef JVX_PROJECT_NAMESPACE
namespace JVX_PROJECT_NAMESPACE {
#endif

void
myCentralWidget::init_submodule(IjvxHost* theHost)
{
mainCentral_host_ww::init_submodule(theHost);
this->setupUi(this);
}

// ===================================================================================

void
myCentralWidget::inform_active(const jvxComponentIdentification& tp, IjvxAccessProperties* theProps)
{
mainCentral_host_ww::inform_active(tp, theProps);
switch (tp.tp)
{
case JVX_COMPONENT_AUDIO_NODE:
thePropRef_algo = theProps;
myWidgetWrapper.associateAutoWidgets(static_cast<QWidget*>(this), thePropRef_algo, static_cast<IjvxQtSaWidgetWrapper_report*>(this), "audio_node");
break;
default:
break;
}
}

void
myCentralWidget::inform_inactive(const jvxComponentIdentification& tp, IjvxAccessProperties* theProps)
{
mainCentral_host_ww::inform_inactive(tp, theProps);
switch (tp.tp)
{
case JVX_COMPONENT_AUDIO_NODE:
myWidgetWrapper.deassociateAutoWidgets("audio_node");
thePropRef_algo = NULL;

break;
default:
break;
}
}

void
myCentralWidget::inform_sequencer_about_to_start()
{
mainCentral_host_ww::inform_sequencer_about_to_start();
}

void
myCentralWidget::inform_sequencer_stopped()
{
mainCentral_host_ww::inform_sequencer_stopped();
}


void
myCentralWidget::inform_update_window(jvxCBitField prio)
{
jvxErrorType res = JVX_NO_ERROR;
mainCentral_host_ww::inform_update_window(prio);
}

void
myCentralWidget::reportCloseEventTriggered()
{
jvxCBitField prio;
jvx_bitFClear(prio);
jvx_bitSet(prio, JVX_REPORT_REQUEST_UPDATE_WINDOW_SHIFT);
inform_update_window(prio);
}

void myCentralWidget::reportUpdateWindow()
{
jvxCBitField prio;
jvx_bitFClear(prio);
jvx_bitSet(prio, JVX_REPORT_REQUEST_UPDATE_WINDOW_SHIFT);
inform_update_window(prio);
}

void
myCentralWidget::preferredSize(jvxInt32& height, jvxInt32& width)
{
QWidget* widg = NULL;
QSize sz = this->size();
//myWidgetJitterMeasure->getMyQWidget(&widg);
//height = widg->minimumHeight();
//width = widg->minimumWidth();
height = sz.height();
width = sz.width();
}

#ifdef JVX_PROJECT_NAMESPACE
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#ifndef __MYCENTRALWIDGET_H__
#define __MYCENTRALWIDGET_H__

#include "jvx.h"
#include "interfaces/qt/mainWindow_UiExtension.h"
#include "ui_myMainWidget.h"
#include <qpixmap.h>

#include "mainCentral_host_ww.h"

#ifdef JVX_PROJECT_NAMESPACE
namespace JVX_PROJECT_NAMESPACE {
#endif

class myCentralWidget: public mainCentral_host_ww, public Ui::Form_myMainWidget
{
private:

IjvxAccessProperties* thePropRef_algo = nullptr;

Q_OBJECT

public:

myCentralWidget(QWidget* parent): mainCentral_host_ww(parent){};
~myCentralWidget(){};

virtual void init_submodule(IjvxHost* theHost)override;

virtual void inform_active(const jvxComponentIdentification& tp, IjvxAccessProperties* theProps)override;

virtual void inform_inactive(const jvxComponentIdentification& tp, IjvxAccessProperties* theProps)override;

virtual void inform_sequencer_about_to_start()override;

virtual void inform_sequencer_stopped()override;


virtual void inform_update_window(jvxCBitField prio = (jvxCBitField)1 << JVX_REPORT_REQUEST_UPDATE_WINDOW_SHIFT)override;

// =====================================================

virtual void reportCloseEventTriggered();
virtual void reportUpdateWindow();

void preferredSize(jvxInt32& height, jvxInt32& width);
signals:

public slots:


};

#ifdef JVX_PROJECT_NAMESPACE
}
#endif

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<RCC>
<qresource prefix="images">
<file>images/splash.png</file>
<file>images/icon_start.png</file>
<file>images/icon_stop.png</file>
<file>images/icon_audiodev.png</file>
<file>images/icon_algorithm.png</file>
<file>images/icon_sequencer.png</file>
<file>images/icon_ready.png</file>
<file>images/icon_notready.png</file>
<file>images/icon_audiodev-small.png</file>
<file>images/icon_algorithm-small.png</file>
<file>images/icon_sequencer-small.png</file>
<file>images/icon_ready-small.png</file>
<file>images/icon_notready-small.png</file>
<file>images/icon_proc.png</file>
<file>images/icon_start_notready.png</file>
</qresource>
</RCC>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form_myMainWidget</class>
<widget class="QWidget" name="Form_myMainWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1302</width>
<height>768</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1300</width>
<height>768</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>7670</width>
<height>4132</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<resources>
<include location="jvxmyNewProject.qrc"/>
</resources>
<connections/>
<slots>
</slots>
</ui>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
Loading

0 comments on commit 2cce0fc

Please sign in to comment.