# Path: pyfeld/dirBrowseExtended.py
# class DirBrowseExtended:
# 
#     def __init__(self):
#         dNull = DirLevel("0", "services", self.retrieve("0"))
#         self.path = "0"
#         self.pathes = ["0"]
#         self.dirs = [dNull]
#         self.depth = 0
#         self.retrieve(self.pathes[self.depth])
# 
#     def get_current_path(self):
#         return self.path
# 
#     def enter(self, index):
#         self.path = self.dirs[self.depth].items[index]['idPath']
#         items = self.retrieve(self.path)
#         new_dir = DirLevel(self.path, self.dirs[self.depth].items[index]['title'], items)
#         self.depth += 1
#         if len(self.dirs) <= self.depth:
#             self.dirs.append(new_dir)
#         else:
#             self.dirs[self.depth] = new_dir
# 
#     def enter_by_friendly_name(self, name):
#         pass
# 
#     def leave(self):
#         if self.depth != 0:
#             self.depth -= 1
#         self.path = self.dirs[self.depth].path
# 
#     def retrieve(self, path):
#         command = rf_command_line()
#         if type(path).__name__ == 'bytes':
#             command += ' "' + path.decode('utf-8') + '"'
#         else:
#             command += ' "' + path + '"'
#         try:
#             process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
#         except Exception as e:
#             return 0
#         jsonFile = ""
#         while True:
#             nextline = process.stdout.readline()
#             if len(nextline) == 0 and process.poll() != None:
#                 break
#             jsonFile += nextline.decode('utf-8')
#         return json.loads(jsonFile)
# 
#     def get_friendly_path_name(self, separator=" -> "):
#         s = ""
#         for i in range(1, self.depth+1):
#             s += self.dirs[i].friendly_name + separator
#         return s[:-len(separator)]  #remove padded separator
# 
#     def get_friendly_name(self, index):
#         return self.dirs[self.depth].items[index]['title']
# 
#     def get_path_for_index(self, index):
#         return self.dirs[self.depth].items[index]['idPath']
# 
#     def get_type(self, index):
#         return self.dirs[self.depth].items[index]['class']
# 
#     def get_albumarturi(self, index):
#         return self.dirs[self.depth].items[index]['albumarturi']
# 
#     def get_album(self, index):
#         return self.dirs[self.depth].items[index]['album']
# 
#     def get_artist(self, index):
#         return self.dirs[self.depth].items[index]['artist']
# 
#     def get_class(self, index):
#         return self.dirs[self.depth].items[index]['class']
# 
#     def get_resourceName(self, index):
#         return self.dirs[self.depth].items[index]['resSourceName']
# 
#     def get_resourceType(self, index):
#         return self.dirs[self.depth].items[index]['resSourceType']
# 
#     def max_entries_on_level(self):
#         return len(self.dirs[self.depth].items)


import json
import subprocess
    from tkinter import *
    from tkinter import ttk
    from tkinter.font import Font
from pyfeld.dirBrowseExtended import DirBrowseExtended
                self.current_row += 1
                for room in zone['rooms']:
                    roomlabel = ttk.Label(text=room['name'])
                    roomlabel.grid(in_=self, row=self.current_row, column=0, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=1, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=2, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=3, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=4, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=5, sticky=EW)
                    self.current_row += 1
            zone_index += 1


class RaumfeldInfo(Frame):
    def __init__(self, parent):
        Frame.__init__(self, master=parent)
        self.room_info = RaumfeldRoomInfo(self)
        self.room_info.pack(side=TOP, expand=N, fill=NONE)
        self.zone_info = CurrentZoneInfo(self)
        self.zone_info.pack(side=TOP, expand=N, fill=NONE)


class RaumfeldBrowseContent(Frame):
    def __init__(self, parent):
        Frame.__init__(self, master=parent)

# Path: pyfeld/dirBrowseExtended.py
# class DirBrowseExtended:
# 
#     def __init__(self):
#         dNull = DirLevel("0", "services", self.retrieve("0"))
#         self.path = "0"
#         self.pathes = ["0"]
#         self.dirs = [dNull]
#         self.depth = 0
#         self.retrieve(self.pathes[self.depth])
# 
#     def get_current_path(self):
#         return self.path
# 
#     def enter(self, index):
#         self.path = self.dirs[self.depth].items[index]['idPath']
#         items = self.retrieve(self.path)
#         new_dir = DirLevel(self.path, self.dirs[self.depth].items[index]['title'], items)
#         self.depth += 1
#         if len(self.dirs) <= self.depth:
#             self.dirs.append(new_dir)
#         else:
#             self.dirs[self.depth] = new_dir
# 
#     def enter_by_friendly_name(self, name):
#         pass
# 
#     def leave(self):
#         if self.depth != 0:
#             self.depth -= 1
#         self.path = self.dirs[self.depth].path
# 
#     def retrieve(self, path):
#         command = rf_command_line()
#         if type(path).__name__ == 'bytes':
#             command += ' "' + path.decode('utf-8') + '"'
#         else:
#             command += ' "' + path + '"'
#         try:
#             process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
#         except Exception as e:
#             return 0
#         jsonFile = ""
#         while True:
#             nextline = process.stdout.readline()
#             if len(nextline) == 0 and process.poll() != None:
#                 break
#             jsonFile += nextline.decode('utf-8')
#         return json.loads(jsonFile)
# 
#     def get_friendly_path_name(self, separator=" -> "):
#         s = ""
#         for i in range(1, self.depth+1):
#             s += self.dirs[i].friendly_name + separator
#         return s[:-len(separator)]  #remove padded separator
# 
#     def get_friendly_name(self, index):
#         return self.dirs[self.depth].items[index]['title']
# 
#     def get_path_for_index(self, index):
#         return self.dirs[self.depth].items[index]['idPath']
# 
#     def get_type(self, index):
#         return self.dirs[self.depth].items[index]['class']
# 
#     def get_albumarturi(self, index):
#         return self.dirs[self.depth].items[index]['albumarturi']
# 
#     def get_album(self, index):
#         return self.dirs[self.depth].items[index]['album']
# 
#     def get_artist(self, index):
#         return self.dirs[self.depth].items[index]['artist']
# 
#     def get_class(self, index):
#         return self.dirs[self.depth].items[index]['class']
# 
#     def get_resourceName(self, index):
#         return self.dirs[self.depth].items[index]['resSourceName']
# 
#     def get_resourceType(self, index):
#         return self.dirs[self.depth].items[index]['resSourceType']
# 
#     def max_entries_on_level(self):
#         return len(self.dirs[self.depth].items)


# Path: pyfeld/tkui.py
import json
import subprocess
    from tkinter import *
    from tkinter import ttk
    from tkinter.font import Font
from pyfeld.dirBrowseExtended import DirBrowseExtended

                self.current_row += 1
                for room in zone['rooms']:
                    roomlabel = ttk.Label(text=room['name'])
                    roomlabel.grid(in_=self, row=self.current_row, column=0, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=1, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=2, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=3, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=4, sticky=EW)
                    vol = ttk.Label(text="-")
                    vol.grid(in_=self, row=self.current_row, column=5, sticky=EW)
                    self.current_row += 1
            zone_index += 1


class RaumfeldInfo(Frame):
    def __init__(self, parent):
        Frame.__init__(self, master=parent)
        self.room_info = RaumfeldRoomInfo(self)
        self.room_info.pack(side=TOP, expand=N, fill=NONE)
        self.zone_info = CurrentZoneInfo(self)
        self.zone_info.pack(side=TOP, expand=N, fill=NONE)


class RaumfeldBrowseContent(Frame):
    def __init__(self, parent):
        Frame.__init__(self, master=parent)

        self.dir_browser = DirBrowseExtended()