Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonathan Wilkes
purr-data
Commits
634a77cc
Commit
634a77cc
authored
16 years ago
by
Miller Puckette
Browse files
Options
Downloads
Patches
Plain Diff
add -batch flag
parent
141cf3c2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/m_sched.c
+14
-5
14 additions, 5 deletions
src/m_sched.c
src/s_main.c
+11
-0
11 additions, 0 deletions
src/s_main.c
with
25 additions
and
5 deletions
src/m_sched.c
+
14
−
5
View file @
634a77cc
...
...
@@ -450,11 +450,11 @@ static void m_pollingscheduler( void)
if
(
!
(
idlecount
&
31
))
{
static
double
idletime
;
if
(
sched_useaudio
!=
SCHED_AUDIO_POLL
)
{
bug
(
"m_pollingscheduler
\n
"
);
return
;
}
if
(
sched_useaudio
!=
SCHED_AUDIO_POLL
)
{
bug
(
"m_pollingscheduler
\n
"
);
return
;
}
/* on 32nd idle, start a clock watch; every
32 ensuing idles, check it */
if
(
idlecount
==
32
)
...
...
@@ -566,6 +566,15 @@ int m_mainloop(void)
return
(
0
);
}
int
m_batchmain
(
void
)
{
sys_time_per_dsp_tick
=
(
TIMEUNITPERSEC
)
*
((
double
)
sys_schedblocksize
)
/
sys_dacsr
;
while
(
sys_quit
!=
SYS_QUIT_QUIT
)
sched_tick
(
sys_time
+
sys_time_per_dsp_tick
);
return
(
0
);
}
/* ------------ thread locking ------------------- */
#ifdef THREAD_LOCKING
...
...
This diff is collapsed.
Click to expand it.
src/s_main.c
+
11
−
0
View file @
634a77cc
...
...
@@ -35,6 +35,7 @@ void sys_findprogdir(char *progname);
int
sys_startgui
(
const
char
*
guipath
);
int
sys_rcfile
(
void
);
int
m_mainloop
(
void
);
int
m_batchmain
(
void
);
void
sys_addhelppath
(
char
*
p
);
#ifdef USEAPI_ALSA
void
alsa_adddev
(
char
*
name
);
...
...
@@ -75,6 +76,7 @@ static int sys_listplease;
int
sys_externalschedlib
;
char
sys_externalschedlibname
[
MAXPDSTRING
];
static
int
sys_batch
;
int
sys_extraflags
;
char
sys_extraflagsstring
[
MAXPDSTRING
];
int
sys_run_scheduler
(
const
char
*
externalschedlibname
,
...
...
@@ -299,6 +301,8 @@ int sys_main(int argc, char **argv)
if
(
sys_externalschedlib
)
return
(
sys_run_scheduler
(
sys_externalschedlibname
,
sys_extraflagsstring
));
else
if
(
sys_batch
)
return
(
m_batchmain
());
else
{
/* open audio and MIDI */
...
...
@@ -394,6 +398,7 @@ static char *(usagemessage[]) = {
"-nosleep -- spin, don't sleep (may lower latency on multi-CPUs)
\n
"
,
"-schedlib <file> -- plug in external scheduler
\n
"
,
"-extraflags <s> -- string argument to send schedlib
\n
"
,
"-batch -- run off-line as a batch process
\n
"
,
};
static
void
sys_parsedevlist
(
int
*
np
,
int
*
vecp
,
int
max
,
char
*
str
)
...
...
@@ -828,6 +833,12 @@ int sys_argparse(int argc, char **argv)
argv
+=
2
;
argc
-=
2
;
}
else
if
(
!
strcmp
(
*
argv
,
"-batch"
))
{
sys_batch
=
1
;
sys_printtostderr
=
sys_nogui
=
1
;
argc
--
;
argv
++
;
}
#ifdef UNISTD
else
if
(
!
strcmp
(
*
argv
,
"-rt"
)
||
!
strcmp
(
*
argv
,
"-realtime"
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment