Permalink
Browse files

fixed bugs and more clean up

  • Loading branch information...
naveedgol committed Nov 28, 2016
1 parent 1b0b921 commit b444d6ced5ce04bec822b20b9ab5a50187340973
View
BIN .DS_Store
Binary file not shown.
View
@@ -7,9 +7,9 @@ elif pgrep -x 'iTunes' &> /dev/null; then
fi
previousSong=
if [ ${currentApp} ]
if [ ${currentApp} ]
then
playerData="$(osascript -e 'tell application "'$currentApp'" to name of current track')"$"~"$"$(osascript -e 'tell application "'$currentApp'" to artist of current track')"
playerData="$(osascript -e 'tell application "'$currentApp'" to name of current track')"$" ~"$"$(osascript -e 'tell application "'$currentApp'" to artist of current track')"
echo $playerData > /dev/cu.usbmodem0E2198D1
fi
########################################
@@ -21,12 +21,12 @@ do
elif pgrep -x 'iTunes' &> /dev/null; then
currentApp="iTunes"
fi
if [ ${currentApp} ]
if [ ${currentApp} ]
then
currentSong="$(osascript -e 'tell application "'$currentApp'" to name of current track')"
currentSong="$(osascript -e 'tell application "'$currentApp'" to name of current track')"$" ~"$"$(osascript -e 'tell application "'$currentApp'" to artist of current track')"
if [ "$previousSong" != "$currentSong" ]
then
playerData="$(osascript -e 'tell application "'$currentApp'" to name of current track')"$"~"$"$(osascript -e 'tell application "'$currentApp'" to artist of current track')"
playerData="$(osascript -e 'tell application "'$currentApp'" to name of current track')"$" ~"$"$(osascript -e 'tell application "'$currentApp'" to artist of current track')"
echo $playerData > /dev/cu.usbmodem0E2198D1
previousSong=$currentSong
fi
View
@@ -64,7 +64,7 @@ do
osascript -e 'tell application "Spotify" to set shuffling to true'
elif [ "$currentApp" = "iTunes" ]
then
osascript -e 'tell application "iTunes" to set shuffle of current playlist to 1'
osascript -e 'tell application "iTunes" to set shuffle enabled to true'
fi;;
i) #turn shuffle off
@@ -73,21 +73,11 @@ do
osascript -e 'tell application "Spotify" to set shuffling to false'
elif [ "$currentApp" = "iTunes" ]
then
osascript -e 'tell application "iTunes" to set shuffle of current playlist to 0'
osascript -e 'tell application "iTunes" to set shuffle enabled to false'
fi;;
v) #volume
vol=${STR:1:1}${STR:2:1}
osascript -e 'tell application "'$currentApp'" to set sound volume to '$vol''
#shuffle)
#shuffleState="$(osascript -e 'tell application "'$currentApp'" to shuffle enabled')"
#if [ $shuffleState = "true" ]
#then
# osascript -e 'tell application "'$currentApp'" to set shuffle enabled to false'
#else
# osascript -e 'tell application "'$currentApp'" to set shuffle enabled to true'
#fi
#;;
esac
done
View
0 tivaScript/buttons.ino 100755 → 100644
No changes.
View
@@ -59,13 +59,14 @@ void drawSongData()
char artist[artistLength];
if(songLength)
{
memcpy(song, inputText, songLength);
memcpy(song, inputText, songLength-1);
memcpy(artist, inputText+songLength+1, artistLength);
OrbitOledMoveTo(0, 0);
OrbitOledDrawString(song);
OrbitOledMoveTo(0, 10);
OrbitOledDrawString(artist);
}else
}
else
{
OrbitOledClearBuffer();
OrbitOledMoveTo(0, 10);
@@ -103,7 +104,8 @@ void drawVolume()
}
}
void drawRemotifyLogo(){
void drawRemotifyLogo()
{
OrbitOledMoveTo(35, 24);
OrbitOledDrawString("Remotify!");
}
@@ -41,20 +41,22 @@ void ShakeTick()
ShakeAccumulator = sqrt(x*x + y*y + z*z);
}
void shakeInitialize(){
void shakeInitialize()
{
ShakeTick();
if(ShakeIsShaking())
{
if(!shuffle)
{
Serial.println('h'); //repeatOn
Serial.println('h'); //shuffleOn
shuffle = true;
}else
}
else
{
Serial.println('i');
Serial.println('i'); //shuffleOff
shuffle = false;
}
delay(200);
delay(delayTime*4);
}
}
@@ -1,8 +1,4 @@
#include <delay.h>
//#include <stdlib.h>
//#include <OrbitBoosterPackDefs.h>
//#include <OrbitOled.h>
//#include <OrbitOledGrph.h>
#include <FillPat.h>
#include <LaunchPad.h>
#include <OrbitBoosterPackDefs.h>
@@ -16,7 +12,6 @@ int previousVolume = -1;
void WireInit();
void ShakeInit();
void ShakeTick();
void setup()
@@ -30,8 +25,7 @@ void setup()
OrbitOledSetDrawMode(modOledSet);
WireInit();
ShakeInit();
//Serial.flush();
ShakeInit();
}
void loop()

0 comments on commit b444d6c

Please sign in to comment.