Skip to content

Commit

Permalink
fixed issue about AVAudioSession.
Browse files Browse the repository at this point in the history
  • Loading branch information
kengo watanabe committed Oct 19, 2016
1 parent 161b619 commit b78655f
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 10 deletions.
9 changes: 7 additions & 2 deletions common/sc_popen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ sc_popen(const char *command, pid_t *pidp, const char *type)
argv[1] = (char *)"-c";
argv[2] = (char *)command;
argv[3] = NULL;

#if defined(SC_TVOS)
(void)close(pdes[0]);
(void)close(pdes[1]);
return (NULL);
#else
switch (pid = fork()) {
case -1: /* Error. */
(void)close(pdes[0]);
Expand Down Expand Up @@ -91,7 +95,8 @@ sc_popen(const char *command, pid_t *pidp, const char *type)
exit(127);
/* NOTREACHED */
}

#endif

/* Parent; assume fdopen can't fail. */
if (*type == 'r') {
iop = fdopen(pdes[0], type);
Expand Down
2 changes: 2 additions & 0 deletions iSCKit/iSC.mm
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ - (id) init
internal_log_view = [[iSCLogView alloc] initWithFrame:[UIScreen mainScreen].bounds];
internal_log_view.textColor = [UIColor blueColor];
internal_log_view.font = [UIFont systemFontOfSize:10.0];
#if !defined(SC_TVOS)
internal_log_view.editable = NO;
#endif
[internal_log_view setAutocapitalizationType:UITextAutocapitalizationTypeNone];
[internal_log_view setAutocorrectionType:UITextAutocorrectionTypeNo];
}
Expand Down
2 changes: 1 addition & 1 deletion lang/LangPrimSource/PyrPrimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4173,7 +4173,7 @@ void initSCViewPrimitives();
void initSchedPrimitives();
initSchedPrimitives();

#if defined(__APPLE__) || defined(HAVE_ALSA) || defined(HAVE_PORTMIDI)
#if (defined(__APPLE__) || defined(HAVE_ALSA) || defined(HAVE_PORTMIDI)) && !defined(SC_TVOS)
void initMIDIPrimitives();
initMIDIPrimitives();
#endif
Expand Down
7 changes: 5 additions & 2 deletions lang/LangPrimSource/PyrUnixPrim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ int prString_System(struct VMGlobals *g, int numArgsPushed)
char cmdline[1024];
int err = slotStrVal(a, cmdline, 1023);
if (err) return err;

#if !defined(SC_TVOS)
int res = system(cmdline);
SetInt(a, res);

#else
SetInt(a, 1);
#endif

return errNone;
}

Expand Down
4 changes: 4 additions & 0 deletions lang/LangPrimSource/SC_CoreMIDI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ added prRestartMIDI
#include <CoreAudio/HostTime.h>
#include <Carbon/Carbon.h>
#endif

#if !defined(SC_TVOS)
#include <CoreMIDI/CoreMIDI.h>
#include <vector>
#include "SCBase.h"
Expand Down Expand Up @@ -809,3 +811,5 @@ void initMIDIPrimitives()
definePrimitive(base, index++, "_SendSysex", prSendSysex, 3, 0);
if(gMIDIClient) midiCleanUp();
}
#endif

Binary file not shown.
8 changes: 4 additions & 4 deletions server/plugins/iPhoneUGens.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <TargetConditionals.h>

#if defined(SC_IPHONE) && !TARGET_IPHONE_SIMULATOR
#if defined(SC_IPHONE) && !TARGET_IPHONE_SIMULATOR && !defined(SC_TVOS)

#import <UIKit/UIKit.h>
#import <CoreMotion/CoreMotion.h>
Expand All @@ -35,7 +35,7 @@

static InterfaceTable *ft;

@interface AccelerometerDelegate : NSObject<UIAccelerometerDelegate>
@interface AccelerometerDelegate : NSObject//<UIAccelerometerDelegate>
{
UIAccelerationValue accel_x, accel_y, accel_z;
}
Expand Down Expand Up @@ -183,18 +183,18 @@ - (id) init
return self;
}

/*
- (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
accel_x = acceleration.x;
accel_y = acceleration.y;
accel_z = acceleration.z;
/*
accel_x += ([acceleration x] - accel_x)*0.8f;
accel_y += ([acceleration y] - accel_y)*0.8f;
accel_z += ([acceleration z] - accel_z)*0.8f;
*/
}
*/

- (float) accel_x
{
Expand Down
2 changes: 1 addition & 1 deletion server/scsynth/SC_CoreAudio.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ void AudioSessionInterruptionCbk(void *inClientData, UInt32 inInterruptionState)
//}
if(av_session.inputAvailable)
{
category = AVAudioSessionCategoryPlayback; // kengo:as03 (playing only)
category = AVAudioSessionCategoryPlayAndRecord; // kengo:as03 (playing only)
//category = AVAudioSessionCategoryAmbient; // kengo:as03-2
}
#endif
Expand Down

0 comments on commit b78655f

Please sign in to comment.