mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-11 04:55:57 +00:00
changed tooltip in projectm config dialog.
removed ' from parsing in shade/warp blocks. allow newlines in parsed string of shade/warp blocks. git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1082 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -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<char> 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<char> & 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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -79,6 +79,8 @@
|
||||
#define WAVE_INIT_STRING "init"
|
||||
#define WAVE_INIT_STRING_LENGTH 4
|
||||
|
||||
#include <set>
|
||||
|
||||
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<char> & skipList = std::set<char>()) ;
|
||||
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);
|
||||
|
||||
@ -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<std::map<int, PerPixelEqn*>::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;x<m_presetInputs.gx;x++){
|
||||
for (x=0;x<m_presetInputs.gx;x++){
|
||||
for(y=0;y<m_presetInputs.gy;y++){
|
||||
m_presetOutputs.cx_mesh[x][y]=m_presetOutputs.cx;
|
||||
}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (x=0;x<m_presetInputs.gx;x++){
|
||||
for(y=0;y<m_presetInputs.gy;y++){
|
||||
|
||||
@ -60,8 +60,8 @@ QPulseAudioDeviceChooser::QPulseAudioDeviceChooser ( QPulseAudioThread * qpulseA
|
||||
hboxLayout->addWidget(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!
|
||||
|
||||
@ -5,10 +5,12 @@
|
||||
#include <QVector>
|
||||
|
||||
|
||||
/* Adopted from PulseAudio.
|
||||
/* Adopted from PulseAudio by carmelo.piccione+projectm@gmail.com
|
||||
|
||||
Copyright 2004-2006 Lennart Poettering
|
||||
Copyright 2006 Pierre Ossman <ossman@cendio.se> 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 ) ) );
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ p, li { white-space: pre-wrap; }
|
||||
<string><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></string>
|
||||
<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></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user