Skip to content

Commit

Permalink
Improved messages on screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
muammar committed Apr 16, 2016
1 parent bb7facd commit 552738a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
8 changes: 6 additions & 2 deletions mkchromecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
print ('Your computer is not connected to any network')
terminate()

print('Switching to soundflower')
print('Switching to soundflower...')

inputdev()
outputdev()

print('Done!')

print('Starting local streaming server')
if args.encoder_backend == 'node':
stream()

Expand All @@ -44,7 +47,8 @@
cc.get_cc()
cc.play_cast()

print('Ctrl-c to kill the application')
print('Ctrl-C to kill the application at any time')
print('')

def terminateapp():
cc.stop_cast()
Expand Down
20 changes: 15 additions & 5 deletions mkchromecast/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ def initialize_cast(self):

if len(self.cclist) != 0 and args.select_cc == False:
print(' ')
print('List of Google cast devices available in your network.')
print('List of Google cast devices available in your network:')
print('------------------------------------------------------')
print(' ')
print('Index Friendly name')
print('===== ============= ')
for self.index,device in enumerate(self.cclist):
print(str(self.index)+': ', str(device))
print(str(self.index)+' ', str(device))
print(' ')
print('We will cast to first device in the list above!')
print(' ')
Expand All @@ -39,10 +43,13 @@ def initialize_cast(self):
self.tf = open('/tmp/mkcrhomecast.tmp', 'wb')
print(' ')
print('List of Google cast devices available in your network:')
print('------------------------------------------------------')
print(' ')
print('Index Friendly name')
print('===== ============= ')
self.availablecc=[]
for self.index,device in enumerate(self.cclist):
print(str(self.index)+': ', str(device))
print(str(self.index)+' ', str(device))
toappend = [self.index,device]
self.availablecc.append(toappend)
#print ('Array')
Expand Down Expand Up @@ -76,7 +83,7 @@ def initialize_cast(self):

def sel_cc(self):
print(' ')
print('Please, select the number of the Google cast device that you want to use:')
print('Please, select the index of the Google cast device that you want to use:')
self.index = input()

def inp_cc(self):
Expand Down Expand Up @@ -112,8 +119,11 @@ def play_cast(self):
ncast.play_media('http://'+localip+':5000/stream', mtype)
else:
ncast.play_media('http://'+localip+':3000/stream.mp3', 'audio/mpeg')
print('Play media status')
print(' ')
print('Cast media cotroller status')
print(' ')
print(ncast.status)
print(' ')

def stop_cast(self):
ncast = self.cast
Expand Down

0 comments on commit 552738a

Please sign in to comment.