From 53d5be6a025b4f30e16c571a5e23f3d8a6bfadfe Mon Sep 17 00:00:00 2001 From: Quentin Millardet Date: Mon, 3 Jun 2024 22:48:48 +0200 Subject: [PATCH] Create version with get information --- LightshowManager.xcodeproj/project.pbxproj | 12 ++ .../xcschemes/LightshowManager.xcscheme | 109 +++++++++++ .../xcdebugger/Breakpoints_v2.xcbkptlist | 18 ++ .../xcschemes/xcschememanagement.plist | 18 ++ LightshowManager/AppDelegate.swift | 1 + LightshowManager/Base.lproj/Main.storyboard | 180 +++++++----------- LightshowManager/LightshowDownloadView.swift | 14 +- LightshowManager/LightshowModel.swift | 40 ++-- 8 files changed, 256 insertions(+), 136 deletions(-) create mode 100644 LightshowManager.xcodeproj/xcshareddata/xcschemes/LightshowManager.xcscheme diff --git a/LightshowManager.xcodeproj/project.pbxproj b/LightshowManager.xcodeproj/project.pbxproj index fae2584..815e8c9 100644 --- a/LightshowManager.xcodeproj/project.pbxproj +++ b/LightshowManager.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 663BEC572BEE2DA0000585D9 /* LightshowDownloadOrAddView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 663BEC562BEE2DA0000585D9 /* LightshowDownloadOrAddView.swift */; }; 66BE20232BD5AA790051989C /* LightshowDownloadCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66BE20222BD5AA790051989C /* LightshowDownloadCell.swift */; }; 66E3889B2BD3371A0004C1F2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66E3889A2BD3371A0004C1F2 /* AppDelegate.swift */; }; 66E3889D2BD3371A0004C1F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66E3889C2BD3371A0004C1F2 /* SceneDelegate.swift */; }; @@ -39,6 +40,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 663BEC562BEE2DA0000585D9 /* LightshowDownloadOrAddView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightshowDownloadOrAddView.swift; sourceTree = ""; }; 668F709C2BE82632004A9EDD /* LightshowManager.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LightshowManager.entitlements; sourceTree = ""; }; 66BE20222BD5AA790051989C /* LightshowDownloadCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightshowDownloadCell.swift; sourceTree = ""; }; 66D401E92BE7EFD1004814D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = ""; }; @@ -118,6 +120,7 @@ 66E388A02BD3371B0004C1F2 /* Main.storyboard */, 66E3889C2BD3371A0004C1F2 /* SceneDelegate.swift */, 66E3889E2BD3371A0004C1F2 /* ViewController.swift */, + 663BEC562BEE2DA0000585D9 /* LightshowDownloadOrAddView.swift */, ); path = LightshowManager; sourceTree = ""; @@ -274,6 +277,7 @@ buildActionMask = 2147483647; files = ( 66E3889F2BD3371A0004C1F2 /* ViewController.swift in Sources */, + 663BEC572BEE2DA0000585D9 /* LightshowDownloadOrAddView.swift in Sources */, 66BE20232BD5AA790051989C /* LightshowDownloadCell.swift in Sources */, 66E388CB2BD548990004C1F2 /* LightshowModel.swift in Sources */, 66E388CD2BD549B90004C1F2 /* LightshowDownloadView.swift in Sources */, @@ -479,6 +483,8 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = io.millardet.LightshowManager; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -510,6 +516,8 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = io.millardet.LightshowManager; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -567,6 +575,8 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = io.millardet.LightshowManagerUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -585,6 +595,8 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = io.millardet.LightshowManagerUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/LightshowManager.xcodeproj/xcshareddata/xcschemes/LightshowManager.xcscheme b/LightshowManager.xcodeproj/xcshareddata/xcschemes/LightshowManager.xcscheme new file mode 100644 index 0000000..02711b3 --- /dev/null +++ b/LightshowManager.xcodeproj/xcshareddata/xcschemes/LightshowManager.xcscheme @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 2a7b109..06e5939 100644 --- a/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -3,4 +3,22 @@ uuid = "92B33A76-5DF7-4616-9CF1-2D8A7367EAE7" type = "1" version = "2.0"> + + + + + + diff --git a/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcschemes/xcschememanagement.plist b/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcschemes/xcschememanagement.plist index b6fc8a1..d2fe617 100644 --- a/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/LightshowManager.xcodeproj/xcuserdata/quentin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -10,5 +10,23 @@ 0 + SuppressBuildableAutocreation + + 66E388962BD3371A0004C1F2 + + primary + + + 66E388AC2BD3371D0004C1F2 + + primary + + + 66E388B62BD3371D0004C1F2 + + primary + + + diff --git a/LightshowManager/AppDelegate.swift b/LightshowManager/AppDelegate.swift index 8930273..32a8346 100644 --- a/LightshowManager/AppDelegate.swift +++ b/LightshowManager/AppDelegate.swift @@ -11,6 +11,7 @@ import UIKit class AppDelegate: UIResponder, UIApplicationDelegate { var model : LightshowModel?; + var teslacamFolder : Bool = false; func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. diff --git a/LightshowManager/Base.lproj/Main.storyboard b/LightshowManager/Base.lproj/Main.storyboard index e25bcae..3e84ec7 100644 --- a/LightshowManager/Base.lproj/Main.storyboard +++ b/LightshowManager/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -13,22 +13,23 @@ - + - @@ -37,29 +38,25 @@ - - - - - + - + diff --git a/LightshowManager/LightshowDownloadView.swift b/LightshowManager/LightshowDownloadView.swift index 6004051..49e7777 100644 --- a/LightshowManager/LightshowDownloadView.swift +++ b/LightshowManager/LightshowDownloadView.swift @@ -29,13 +29,13 @@ class LightshowDownloadView: UITableViewController{ let isOk : Bool = model?.isOkFiles() ?? false; - (cell as! LightshowDownloadCell).LightshowName.text = model?.name - (cell as! LightshowDownloadCell).warningMessage.isHidden = isOk; - var alertText = "" - if (!isOk){ - alertText = "(Le fichcier mp3 ou fseq n'a pas été reconnu)" - } - (cell as! LightshowDownloadCell).alertLabel.text = alertText + //(cell as! LightshowDownloadCell).LightshowName.text = model?.name + //(cell as! LightshowDownloadCell).warningMessage.isHidden = isOk; + //var alertText = "" + //if (!isOk){ +// alertText = "(Le fichcier mp3 ou fseq n'a pas été reconnu)" + //} + //(cell as! LightshowDownloadCell).alertLabel.text = alertText return cell! } diff --git a/LightshowManager/LightshowModel.swift b/LightshowManager/LightshowModel.swift index c615111..25dfd31 100644 --- a/LightshowManager/LightshowModel.swift +++ b/LightshowManager/LightshowModel.swift @@ -34,6 +34,7 @@ struct URLLightshow { class LightshowModel{ var names : Array = [] ; + let extensionsFile : Array = ["mp3", "wav", "fseq"]; init(){ @@ -74,26 +75,31 @@ class LightshowModel{ func setStudentAtIndex(_ index: Int, withdraw value : String){ var filenameArray = value.split(separator: ".") - filenameArray.remove(at: filenameArray.count - 1) + let filenameExtension = String(filenameArray[filenameArray.count - 1]); - let valueNomalized = filenameArray.joined() - - var foundLightshow : Lightshow! = nil; - - for lightshow in names { - if (lightshow.name == valueNomalized ){ - foundLightshow = lightshow; + if (self.extensionsFile.contains(filenameExtension)){ + filenameArray.remove(at: filenameArray.count - 1) + + let valueNomalized = filenameArray.joined() + + var foundLightshow : Lightshow! = nil; + + for lightshow in names { + if (lightshow.name == valueNomalized ){ + foundLightshow = lightshow; + } + } + if (foundLightshow == nil){ + foundLightshow = Lightshow(valueNomalized); + names.append(foundLightshow) + } + if (filenameExtension == "mp3" || filenameExtension == "wav"){ + foundLightshow.urls.mp3 = value; + } else if (value.contains(".fseq")){ + foundLightshow.urls.fseq = value; } } - if (foundLightshow == nil){ - foundLightshow = Lightshow(valueNomalized); - names.append(foundLightshow) - } - if (value.contains(".mp3")){ - foundLightshow.urls.mp3 = value; - } else if (value.contains(".fseq")){ - foundLightshow.urls.fseq = value; - } + } func resetStundent() -> Void {