diff --git a/src/projectM-engine/Parser.cpp b/src/projectM-engine/Parser.cpp index d06ac0359..dc2332f6f 100755 --- a/src/projectM-engine/Parser.cpp +++ b/src/projectM-engine/Parser.cpp @@ -442,7 +442,7 @@ int Parser::parse_line(std::istream & fs, Preset * preset) if (!strncmp(eqn_string, WARP_STRING, WARP_STRING_LENGTH)) { std::cout << "parsing warp string block\n" << std::endl; - parse_string_block(fs, &preset->presetOutputs().shader.warp); + parse_string_block(fs, &preset->presetOutputs().shader.warp); return PROJECTM_SUCCESS; } @@ -1538,7 +1538,9 @@ void Parser::parse_string_block(std::istream & fs, std::string * out_string) { char name[MAX_TOKEN_SIZE]; token_t token; - readStringUntil(fs, out_string); + std::set skipList; + skipList.insert('`'); + readStringUntil(fs, out_string, false, skipList); std::cout << "out_string:\n " << *out_string << "\n" << std::endl; @@ -1641,12 +1643,11 @@ InitCond * Parser::parse_per_frame_init_eqn(std::istream & fs, Preset * preset, } -void Parser::readStringUntil(std::istream & fs, std::string * out_buffer, bool wrapAround) { +void Parser::readStringUntil(std::istream & fs, std::string * out_buffer, bool wrapAround, const std::set & skipList) { int string_line_buffer_index = 0; char c; - - + /* Loop until a delimiter is found, or the maximum string size is found */ while (true) { @@ -1660,6 +1661,7 @@ void Parser::readStringUntil(std::istream & fs, std::string * out_buffer, bool w switch (c) { case '\n': + line_count++; if (wrapAround) { @@ -1700,7 +1702,8 @@ void Parser::readStringUntil(std::istream & fs, std::string * out_buffer, bool w } break; - } + } else + out_buffer->push_back(c); return; case EOF: line_count = 1; @@ -1708,8 +1711,10 @@ void Parser::readStringUntil(std::istream & fs, std::string * out_buffer, bool w default: if (out_buffer != NULL) - { - out_buffer->push_back(c); + { + if (skipList.find(c) == skipList.end()) + out_buffer->push_back(c); + } } diff --git a/src/projectM-engine/Parser.hpp b/src/projectM-engine/Parser.hpp index 9d299f437..5354a5a81 100755 --- a/src/projectM-engine/Parser.hpp +++ b/src/projectM-engine/Parser.hpp @@ -79,6 +79,8 @@ #define WAVE_INIT_STRING "init" #define WAVE_INIT_STRING_LENGTH 4 +#include + typedef enum { UNSET_LINE_MODE, PER_FRAME_LINE_MODE, @@ -178,7 +180,7 @@ public: static int parse_wave(char * eqn_string, std::istream & fs, Preset * preset); static int parse_shape(char * eqn_string, std::istream & fs, Preset * preset); static int parse_shape_prefix(char * token, int * id, char ** eqn_string); - static void readStringUntil(std::istream & fs, std::string * out_buffer, bool wrapAround = true) ; + static void readStringUntil(std::istream & fs, std::string * out_buffer, bool wrapAround = true, const std::set & skipList = std::set()) ; static int update_string_buffer(char * buffer, int * index); static int string_to_float(char * string, float * float_ptr); static int parse_shape_per_frame_init_eqn(std::istream & fs, CustomShape * custom_shape, Preset * preset); diff --git a/src/projectM-engine/Preset.cpp b/src/projectM-engine/Preset.cpp index d3ecf3cd7..6900da6d0 100755 --- a/src/projectM-engine/Preset.cpp +++ b/src/projectM-engine/Preset.cpp @@ -129,7 +129,6 @@ int Preset::add_per_pixel_eqn(char * name, GenExpr * gen_expr) - /* Insert the per pixel equation into the preset per pixel database */ std::pair::iterator, bool> inserteeOption = per_pixel_eqn_tree.insert (std::make_pair(per_pixel_eqn->index, per_pixel_eqn)); @@ -351,10 +350,8 @@ void Preset::evaluateFrame() // Evaluate all equation objects according to milkdrop flow diagram evalPerFrameInitEquations(); - evalPerFrameEquations(); - // Important step to ensure custom shapes and waves don't stamp on the q variable values // calculated by the per frame (init) and per pixel equations. transfer_q_variables(customWaves); @@ -381,13 +378,13 @@ void Preset::initialize_PerPixelMeshes() { int x,y; - for (x=0;xaddWidget(this->layoutWidget); this->setLayout(hboxLayout); - - connect ( tryFirstPlayBackMonitorCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updateDevicesListViewLock(int))); + connect ( tryFirstPlayBackMonitorCheckBox, + SIGNAL(stateChanged(int)), this, SLOT(updateDevicesListViewLock(int))); /// @bug wrong! should be based on HASH index, not display index /// @bug wait! it's ok because we are piping the text, not the device index to the connect method! diff --git a/src/projectM-pulseaudio/QPulseAudioThread.cpp b/src/projectM-pulseaudio/QPulseAudioThread.cpp index 39366e650..14573fad3 100644 --- a/src/projectM-pulseaudio/QPulseAudioThread.cpp +++ b/src/projectM-pulseaudio/QPulseAudioThread.cpp @@ -5,10 +5,12 @@ #include -/* Adopted from PulseAudio. +/* Adopted from PulseAudio by carmelo.piccione+projectm@gmail.com Copyright 2004-2006 Lennart Poettering Copyright 2006 Pierre Ossman for Cendio AB + + ***/ #ifdef HAVE_CONFIG_H @@ -90,8 +92,7 @@ QPulseAudioThread::SourceContainer::const_iterator QPulseAudioThread::readSettin return s_sourceList.end(); } else { - QString deviceName = settings.value("pulseAudioDeviceName", QString()).toString(); - + QString deviceName = settings.value("pulseAudioDeviceName", QString()).toString(); qDebug() << "device name is " << deviceName; for (SourceContainer::const_iterator pos = s_sourceList.begin(); pos != s_sourceList.end(); ++pos) { @@ -296,7 +297,7 @@ void QPulseAudioThread::pulseQuit ( int ret ) assert ( mainloop_api ); mainloop_api->quit ( mainloop_api, ret ); if (*s_qprojectM_MainWindowPtr) - delete(*s_qprojectM_MainWindowPtr); + delete(*s_qprojectM_MainWindowPtr); *s_qprojectM_MainWindowPtr = 0; } @@ -317,6 +318,9 @@ void QPulseAudioThread::stream_read_callback ( pa_stream *s, size_t length, void return; } + if ((!s_qprojectM_MainWindowPtr) || (!*s_qprojectM_MainWindowPtr)) + return; + assert ( data && length ); if ( buffer ) @@ -330,7 +334,6 @@ void QPulseAudioThread::stream_read_callback ( pa_stream *s, size_t length, void return; } - (*s_qprojectM_MainWindowPtr)->addPCM( (float*)data, length / ( sizeof ( float ) ) ); diff --git a/src/projectM-pulseaudio/qprojectM-pulseaudio.cpp b/src/projectM-pulseaudio/qprojectM-pulseaudio.cpp index 733aa39e3..1a558c3b6 100644 --- a/src/projectM-pulseaudio/qprojectM-pulseaudio.cpp +++ b/src/projectM-pulseaudio/qprojectM-pulseaudio.cpp @@ -107,8 +107,7 @@ int main ( int argc, char*argv[] ) QPulseAudioThread * pulseThread = new QPulseAudioThread(argc, argv, mainWindow); pulseThread->start(); - - + //QApplication::connect // (mainWindow->qprojectMWidget(), SIGNAL(projectM_Initialized(QProjectM *)), pulseThread, SLOT(setQrojectMWidget(QProjectMWidget*))); @@ -125,7 +124,6 @@ int main ( int argc, char*argv[] ) pulseThread->cleanup(); - delete(pulseThread); return ret; } diff --git a/src/projectM-qt/qprojectmconfigdialog.ui b/src/projectM-qt/qprojectmconfigdialog.ui index 4e1d35202..26de60357 100644 --- a/src/projectM-qt/qprojectmconfigdialog.ui +++ b/src/projectM-qt/qprojectmconfigdialog.ui @@ -95,7 +95,7 @@ p, li { white-space: pre-wrap; } <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">This sets the default preset playlist file when qprojectM starts up. The file must be a valid preset playlist (of type *.ppl). If specified, this overrides the <span style=" font-style:italic;">Playlist Directory</span> value on startup. </p></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">This sets the default preset playlist file when projectM starts up. The file must be a valid preset playlist (of type *.ppl). If specified, this overrides the <span style=" font-style:italic;">Playlist Directory</span> value on startup. </p></body></html>