Skip to content

Commit d0f934e

Browse files
committed
Reorganized source tree and fixed some code to make the frontend compile again.
1 parent 17cf4ab commit d0f934e

File tree

150 files changed

+257
-1301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+257
-1301
lines changed

Diff for: CMakeLists.txt

+68-224
Large diffs are not rendered by default.

Diff for: cmake/FindJACK.cmake

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# First try to use PKG_CONFIG to find JACK.
2+
find_package(PkgConfig QUIET)
3+
if(PKG_CONFIG_FOUND)
4+
pkg_check_modules(JACK jack QUIET)
5+
endif()
6+
7+
if(NOT JACK_INCLUDEDIR OR NOT JACK_LIBRARIES)
8+
find_path(JACK_INCLUDEDIR
9+
jack/jack.h
10+
)
11+
12+
find_library(JACK_LIBRARIES
13+
jack
14+
)
15+
endif()
16+
17+
include(FindPackageHandleStandardArgs)
18+
19+
find_package_handle_standard_args(JACK
20+
REQUIRED_VARS JACK_LIBRARIES JACK_INCLUDEDIR
21+
VERSION_VAR JACK_VERSION
22+
)
23+
24+
if(JACK_FOUND AND NOT TARGET JACK::JACK)
25+
add_library(JACK::JACK INTERFACE IMPORTED)
26+
27+
set_target_properties(JACK::JACK PROPERTIES
28+
INTERFACE_LINK_LIBRARIES "${JACK_LIBRARIES}"
29+
INTERFACE_LINK_DIRECTORIES "${JACK_LIBRARY_DIRS}"
30+
INTERFACE_INCLUDE_DIRECTORIES "${JACK_INCLUDEDIR}"
31+
INTERFACE_COMPILE_OPTIONS "${JACK_CFLAGS}"
32+
)
33+
endif()

Diff for: cmake/FindPulseaudio.cmake

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# First try to use PKG_CONFIG to find Pulseaudio.
2+
find_package(PkgConfig QUIET)
3+
if(PKG_CONFIG_FOUND)
4+
pkg_check_modules(PULSEAUDIO libpulse QUIET)
5+
endif()
6+
7+
if(NOT PULSEAUDIO_INCLUDEDIR OR NOT PULSEAUDIO_LIBRARIES)
8+
find_path(PULSEAUDIO_INCLUDEDIR
9+
pulse/pulseaudio.h
10+
)
11+
12+
find_library(PULSEAUDIO_LIBRARIES
13+
pulse
14+
)
15+
16+
if(PULSEAUDIO_INCLUDEDIR AND EXISTS "${PULSEAUDIO_INCLUDEDIR}/pulse/version.h")
17+
file(STRINGS "${PULSEAUDIO_INCLUDEDIR}/pulse/version.h" pulseaudio_version_str
18+
REGEX "pa_get_headers_version\(\)"
19+
)
20+
if(pulseaudio_version_str AND "${pulseaudio_version_str}" MATCHES "\\(\"([0-9.]+)\"\\)")
21+
set(PULSEAUDIO_VERSION "${CMAKE_MATCH_1}")
22+
endif()
23+
endif()
24+
25+
set(PULSEAUDIO_CFLAGS "-D_REENTRANT")
26+
endif()
27+
28+
include(FindPackageHandleStandardArgs)
29+
30+
find_package_handle_standard_args(Pulseaudio
31+
REQUIRED_VARS PULSEAUDIO_LIBRARIES PULSEAUDIO_INCLUDEDIR
32+
VERSION_VAR PULSEAUDIO_VERSION
33+
)
34+
35+
if(Pulseaudio_FOUND AND NOT TARGET Pulseaudio::Pulseaudio)
36+
add_library(Pulseaudio::Pulseaudio INTERFACE IMPORTED)
37+
38+
set_target_properties(Pulseaudio::Pulseaudio PROPERTIES
39+
INTERFACE_LINK_LIBRARIES "${PULSEAUDIO_LIBRARIES}"
40+
INTERFACE_LINK_DIRECTORIES "${PULSEAUDIO_LIBRARY_DIRS}"
41+
INTERFACE_INCLUDE_DIRECTORIES "${PULSEAUDIO_INCLUDEDIR}"
42+
INTERFACE_COMPILE_OPTIONS "${PULSEAUDIO_CFLAGS}"
43+
)
44+
endif()

Diff for: src/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_subdirectory(common)
2+
add_subdirectory(ui-jack)
3+
add_subdirectory(ui-pulseaudio)
File renamed without changes.

Diff for: src/projectM-qt/CMakeLists.txt renamed to src/common/CMakeLists.txt

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
if(NOT ENABLE_QT)
2-
return()
3-
endif()
4-
5-
# Automatically create .moc files and run the UIC and resource compilers
6-
set(CMAKE_AUTOMOC ON)
7-
set(CMAKE_AUTOUIC ON)
8-
set(CMAKE_AUTORCC ON)
9-
10-
add_library(projectM-qt STATIC
1+
add_library(projectM-Qt-Common STATIC
112
application.qrc
123
configfile.cpp
134
configfile.hpp
@@ -34,19 +25,19 @@ add_library(projectM-qt STATIC
3425
qxmlplaylisthandler.hpp
3526
)
3627

37-
set_target_properties(projectM-qt PROPERTIES
28+
set_target_properties(projectM-Qt-Common PROPERTIES
3829
C_VISIBILITY_PRESET default
3930
CXX_VISIBILITY_PRESET default
4031
VISIBILITY_INLINES_HIDDEN OFF
4132
)
4233

43-
target_include_directories(projectM-qt
34+
target_include_directories(projectM-Qt-Common
4435
PUBLIC
4536
"${CMAKE_CURRENT_SOURCE_DIR}"
4637
)
4738

48-
target_link_libraries(projectM-qt
39+
target_link_libraries(projectM-Qt-Common
4940
PUBLIC
50-
projectM::libprojectM
41+
libprojectM::$<IF:$<BOOL:ENABLE_SHARED_LINKING>,shared,static>
5142
${QT_LINK_TARGETS}
5243
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/projectM-qt/qplaylistmodel.cpp renamed to src/common/qplaylistmodel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*/
2121

22-
#include "projectM.h"
22+
#include <libprojectM/projectM.h>
2323

2424
#include <QIcon>
2525
#include <QXmlStreamReader>

Diff for: src/projectM-qt/qplaylistmodel.hpp renamed to src/common/qplaylistmodel.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <QAbstractTableModel>
2727
#include <QVector>
2828

29-
#include <projectM.hpp>
3029
#include <QStringList>
3130
#include <QtDebug>
3231

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/projectM-qt/qpresetfiledialog.hpp renamed to src/common/qpresetfiledialog.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <QMainWindow>
2929
#include <QCloseEvent>
3030
#include <cassert>
31-
#include <projectM.hpp>
3231

3332
#include <iostream>
3433
#include <QFileDialog>
File renamed without changes.
File renamed without changes.

Diff for: src/projectM-qt/qprojectm.hpp renamed to src/common/qprojectm.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef QPROJECTM_HPP
2323
#define QPROJECTM_HPP
2424

25-
#include "projectM.h"
25+
#include <libprojectM/projectM.h>
2626

2727
#include <QObject>
2828
#include <QString>
@@ -34,7 +34,7 @@ Q_OBJECT
3434

3535
public:
3636
explicit QProjectM(const QString& config_file)
37-
: _projectM(projectm_create(config_file.toLocal8Bit().data(), projectM::FLAG_DISABLE_PLAYLIST_LOAD))
37+
: _projectM(projectm_create(config_file.toLocal8Bit().data(), projectm_flags::PROJECTM_FLAG_DISABLE_PLAYLIST_LOAD))
3838
{
3939
projectm_set_preset_switched_event_callback(_projectM, &QProjectM::presetSwitchedEvent, this);
4040
projectm_set_preset_switch_failed_event_callback(_projectM, &QProjectM::presetSwitchFailedEvent, this);

Diff for: src/projectM-qt/qprojectm_mainwindow.cpp renamed to src/common/qprojectm_mainwindow.cpp

+15-14
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,25 @@
1919
*
2020
*/
2121

22-
#include <QtWidgets>
23-
#include "qprojectm_mainwindow.hpp"
24-
#include "qpresetfiledialog.hpp"
22+
#include "configfile.hpp"
23+
#include "nullable.hpp"
2524
#include "qplaylistfiledialog.hpp"
26-
#include <QTextStream>
27-
#include <QCloseEvent>
28-
#include <QFileDialog>
29-
3025
#include "qplaylistmodel.hpp"
26+
#include "qpreseteditordialog.hpp"
27+
#include "qpresetfiledialog.hpp"
3128
#include "qpresettextedit.hpp"
32-
#include "ui_qprojectm_mainwindow.h"
29+
#include "qprojectm_mainwindow.hpp"
3330
#include "qprojectmconfigdialog.hpp"
34-
#include "qpreseteditordialog.hpp"
35-
#include "ui_qpreseteditordialog.h"
36-
#include "configfile.hpp"
37-
#include "qxmlplaylisthandler.hpp"
38-
#include "nullable.hpp"
3931
#include "qprojectmwidget.hpp"
32+
#include "qxmlplaylisthandler.hpp"
33+
#include "ui_qpreseteditordialog.h"
34+
#include "ui_qprojectm_mainwindow.h"
35+
36+
#include <QtWidgets>
37+
#include <QTextStream>
38+
#include <QCloseEvent>
39+
#include <QFileDialog>
40+
4041

4142
class PlaylistWriteFunctor {
4243
public:
@@ -1290,7 +1291,7 @@ void QProjectM_MainWindow::updateFilteredPlaylist ( const QString & text )
12901291
}
12911292

12921293

1293-
void QProjectM_MainWindow::presetRatingChanged( unsigned int index, int rating, PresetRatingType ratingType)
1294+
void QProjectM_MainWindow::presetRatingChanged( unsigned int index, int rating, projectm_preset_rating_type ratingType)
12941295
{
12951296
Q_UNUSED(ratingType);
12961297

Diff for: src/projectM-qt/qprojectm_mainwindow.hpp renamed to src/common/qprojectm_mainwindow.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#define QPROJECTM_MAINWINDOW_H
2424
#define CONFIG_FILE "/share/projectM/config.inp"
2525

26+
#include <libprojectM/projectM.h>
27+
2628
#include <QMainWindow>
2729
#include <QCloseEvent>
2830
#include <cassert>
@@ -31,9 +33,8 @@
3133
#include <QtDebug>
3234
#include <QMutex>
3335

34-
#include "projectM.hpp"
35-
3636
#include <QModelIndexList>
37+
3738
class QHeaderView;
3839
class QAction;
3940
class QMenu;
@@ -118,7 +119,7 @@ class QProjectM_MainWindow:public QMainWindow
118119

119120
private slots:
120121
void dockLocationChanged(Qt::DockWidgetArea area);
121-
void presetRatingChanged(unsigned int, int, PresetRatingType);
122+
void presetRatingChanged(unsigned int, int, projectm_preset_rating_type);
122123
void handleFailedPresetSwitch(const bool isHardCut, const unsigned int index,
123124
const QString & message);
124125

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/projectM-jack/CMakeLists.txt

-11
This file was deleted.

Diff for: src/projectM-jack/HTTPRemoteControl.cpp

-59
This file was deleted.

Diff for: src/projectM-jack/HTTPRemoteControl.h

-27
This file was deleted.

Diff for: src/projectM-jack/projectM-jack-sdl.cmake

-25
This file was deleted.

0 commit comments

Comments
 (0)