appMain.brs (1920B)
1 '******************************************************************** 2 '** Home Media Server Application - Main 3 '** Copyright (c) 2010-2013 Brian C. Lane All Rights Reserved. 4 '******************************************************************** 5 Sub Main() 6 'initialize theme attributes like titles, logos and overhang color 7 initTheme() 8 9 ' Get server url and make sure it is valid 10 valid_dir = false 11 force_edit = false 12 while not valid_dir 13 valid_dir = checkServerUrl(force_edit) 14 dir = getDirectoryListing( "http://"+RegRead("ServerURL") ) 15 if dir = invalid then 16 force_edit = true 17 valid_dir = false 18 end if 19 end while 20 21 ' Check to see if the server supports keystore 22 has_keystore = isUrlValid("http://"+RegRead("ServerURL")+"/keystore/version") 23 24 roGridMediaServer("http://"+RegRead("ServerURL"), has_keystore) 25 ' TODO NEED TO FIX SETUP 26 ' roPosterMediaServer("http://"+RegRead("ServerURL"), has_keystore) 27 End Sub 28 29 30 '************************************************************* 31 '** Set the configurable theme attributes for the application 32 '** 33 '** Configure the custom overhang and Logo attributes 34 '** Theme attributes affect the branding of the application 35 '** and are artwork, colors and offsets specific to the app 36 '************************************************************* 37 Sub initTheme() 38 39 app = CreateObject("roAppManager") 40 theme = CreateObject("roAssociativeArray") 41 42 theme.OverhangOffsetSD_X = "72" 43 theme.OverhangOffsetSD_Y = "31" 44 theme.OverhangSliceSD = "pkg:/images/Overhang_Background_SD.png" 45 theme.OverhangLogoSD = "pkg:/images/Overhang_Logo_SD.png" 46 47 theme.OverhangOffsetHD_X = "125" 48 theme.OverhangOffsetHD_Y = "35" 49 theme.OverhangSliceHD = "pkg:/images/Overhang_Background_HD.png" 50 theme.OverhangLogoHD = "pkg:/images/Overhang_Logo_HD.png" 51 52 app.SetTheme(theme) 53 54 End Sub 55