mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-18 23:35:49 +00:00
PJS: Fedora Lib64 patch from Stewart Adams
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@712 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -38,7 +38,7 @@ FILE(GLOB presets "presets/*.milk" "presets/*.prjm" "presets/*.tga")
|
||||
INSTALL(FILES ${presets} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM/presets)
|
||||
FILE(GLOB fonts "fonts/*.ttf")
|
||||
INSTALL(FILES ${fonts} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM/fonts)
|
||||
INSTALL(FILES "${CMAKE_BINARY_DIR}/libprojectM.pc" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
|
||||
INSTALL(FILES "${CMAKE_BINARY_DIR}/libprojectM.pc" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig)
|
||||
INSTALL(FILES config.inp DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM)
|
||||
INSTALL(FILES projectM.hpp event.h dlldefs.h fatal.h PresetFrameIO.hpp PCM.hpp DESTINATION include/libprojectM)
|
||||
INSTALL(TARGETS projectM DESTINATION lib)
|
||||
|
||||
@ -21,4 +21,4 @@ TARGET_LINK_LIBRARIES(projectM-test projectM ${SDL_LIBRARY} ${GTK_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(projectM-test-memleak projectM ${SDL_LIBRARY} ${GTK_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(projectM-test-texture projectM ${SDL_LIBRARY} ${GTK_LIBRARIES})
|
||||
|
||||
#INSTALL(TARGETS projectM-test DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/xmms/Visualization )
|
||||
#INSTALL(TARGETS projectM-test DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/xmms/Visualization )
|
||||
|
||||
@ -16,4 +16,4 @@ LINK_DIRECTORIES(${PROJECTM_LDFLAGS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(xmms_projectM projectM ${SDL_LIBRARY} ${GTK_LIBRARIES})
|
||||
|
||||
INSTALL(TARGETS xmms_projectM DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/xmms/Visualization )
|
||||
INSTALL(TARGETS xmms_projectM DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/xmms/Visualization )
|
||||
@ -22,4 +22,4 @@ ADD_LIBRARY(qprojectM-xmms SHARED main.cpp ConfigFile.h ConfigFile.cpp)
|
||||
|
||||
TARGET_LINK_LIBRARIES(qprojectM-xmms qprojectM projectM ${GTK_LIBRARIES} ${QT_QTGUI_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${QT_LIBRARIES})
|
||||
|
||||
INSTALL(TARGETS qprojectM-xmms DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/xmms/Visualization )
|
||||
INSTALL(TARGETS qprojectM-xmms DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/xmms/Visualization )
|
||||
@ -28,8 +28,10 @@ www.gamedev.net/reference/programming/features/beatdetection/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <xmms/plugin.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
@ -56,7 +58,8 @@ extern "C" void projectM_playback_stop(void);
|
||||
extern "C" void projectM_render_pcm(gint16 pcm_data[2][512]);
|
||||
extern "C" void projectM_render_freq(gint16 pcm_data[2][256]);
|
||||
extern "C" VisPlugin *get_vplugin_info();
|
||||
void *worker(void *);
|
||||
//void *worker(void *);
|
||||
int worker();
|
||||
std::string read_config();
|
||||
void saveSnapshotToFile();
|
||||
//extern preset_t * active_preset;
|
||||
@ -153,22 +156,48 @@ QProjectM_MainWindow *mainWindow;
|
||||
int retval;
|
||||
pthread_t thread;
|
||||
|
||||
pid_t pID;
|
||||
|
||||
extern "C" void projectM_xmms_init(void)
|
||||
{
|
||||
retval = pthread_create( &thread, NULL, worker, NULL);
|
||||
// retval = pthread_create( &thread, NULL, worker, NULL);
|
||||
|
||||
pID = clone();
|
||||
if (pID == 0) // child
|
||||
{
|
||||
// Code only executed by child process
|
||||
|
||||
worker();
|
||||
exit(1);
|
||||
}
|
||||
else if (pID < 0) // failed to fork
|
||||
{
|
||||
std::cerr << "Failed to fork" << std::endl;
|
||||
exit(1);
|
||||
// Throw exception
|
||||
}
|
||||
else // parent
|
||||
{
|
||||
// Code only executed by parent process
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool initialized = false;
|
||||
|
||||
void *worker(void *)
|
||||
int worker()
|
||||
//void *worker(void *)
|
||||
{
|
||||
int argc; char **argv;
|
||||
argc = 0;
|
||||
|
||||
|
||||
// Start a new qapplication
|
||||
//QApplication app(argc,argv);
|
||||
app = new QApplication(argc,argv);
|
||||
QApplication app(argc,argv);
|
||||
//app = new QApplication(argc,argv);
|
||||
std::string config_file;
|
||||
config_file = read_config();
|
||||
|
||||
@ -177,7 +206,7 @@ void *worker(void *)
|
||||
|
||||
globalPM = mainWindow->getQProjectM();
|
||||
initialized = true;
|
||||
app->exec();
|
||||
return app.exec();
|
||||
|
||||
}
|
||||
|
||||
@ -186,12 +215,12 @@ extern "C" void projectM_cleanup(void)
|
||||
{
|
||||
initialized = false;
|
||||
mainWindow->close(); ;
|
||||
pthread_join(thread, NULL);
|
||||
//pthread_join(thread, NULL);
|
||||
|
||||
delete(mainWindow);
|
||||
mainWindow = NULL;
|
||||
delete(app);
|
||||
app = NULL;
|
||||
// delete(mainWindow);
|
||||
// mainWindow = NULL;
|
||||
// delete(app);
|
||||
// app = NULL;
|
||||
|
||||
// printf("projectM plugin: Cleanup completed\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user