Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

30-40% Ready #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added PodcastCutter/.DS_Store
Binary file not shown.
485 changes: 485 additions & 0 deletions PodcastCutter/PodcastCutter.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
<FileBreakpoints>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "PodcastCutter/CueParser.m"
timestampString = "378166798.028503"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "32"
endingLineNumber = "32"
landmarkName = "-ParseCueFile:"
landmarkType = "5">
</FileBreakpoint>
</FileBreakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7D0973BC166E739700512545"
BuildableName = "PodcastCutter.app"
BlueprintName = "PodcastCutter"
ReferencedContainer = "container:PodcastCutter.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7D0973DD166E739700512545"
BuildableName = "PodcastCutterTests.octest"
BlueprintName = "PodcastCutterTests"
ReferencedContainer = "container:PodcastCutter.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7D0973BC166E739700512545"
BuildableName = "PodcastCutter.app"
BlueprintName = "PodcastCutter"
ReferencedContainer = "container:PodcastCutter.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7D0973BC166E739700512545"
BuildableName = "PodcastCutter.app"
BlueprintName = "PodcastCutter"
ReferencedContainer = "container:PodcastCutter.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7D0973BC166E739700512545"
BuildableName = "PodcastCutter.app"
BlueprintName = "PodcastCutter"
ReferencedContainer = "container:PodcastCutter.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>PodcastCutter.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>7D0973BC166E739700512545</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>7D0973DD166E739700512545</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
28 changes: 28 additions & 0 deletions PodcastCutter/PodcastCutter/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// AppDelegate.h
// PodcastCutter
//
// Created by Arthur Belous on 04.12.12.
// Copyright (c) 2012 Arthur Belous. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "CueParser.h"

@interface AppDelegate : NSObject <NSApplicationDelegate>
{
NSMutableArray *arrayOfMp3Index;
NSMutableArray *arrayOfMp3Title;
NSMutableArray *arrayOfMp3Performer;
NSMutableArray *arrayOfMp3Track;}
@property (assign) IBOutlet NSWindow *window;

-(NSString*) OpenFile;


@property (weak) IBOutlet NSTextField *albumArtist;
@property (weak) IBOutlet NSTextField *albumTitle;
@property (weak) IBOutlet NSComboBox *genreTypeList;


@end
56 changes: 56 additions & 0 deletions PodcastCutter/PodcastCutter/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// AppDelegate.m
// PodcastCutter
//
// Created by Arthur Belous on 04.12.12.
// Copyright (c) 2012 Arthur Belous. All rights reserved.
//

#import "AppDelegate.h"

@implementation AppDelegate

-(NSString*) OpenFile // Select file in NSOpenPanel for get path of *.cue or *.mp3 files
{
NSString *FilePath;
// Define file types for our app, exclud all the other extension formats
NSArray* fileTypes = [[NSArray alloc] initWithObjects:@"cue", @"Cue", @"CUE", nil];

// Create instance of NSOpenPanel
NSOpenPanel *myOpenPanel = [NSOpenPanel openPanel];

//Set parameters for our open panel
[myOpenPanel setAllowsMultipleSelection:NO];
[myOpenPanel setAllowedFileTypes:fileTypes];
[myOpenPanel setAllowsOtherFileTypes:NO];

if ( [myOpenPanel runModal] == NSOKButton )
{
FilePath = [[myOpenPanel URL]path]; // Get file path of selected *.cue file
}
return FilePath;
}

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Please , choose a *.cue file for cutting ! "];
[alert runModal];

NSString *SelectedFileIs = [self OpenFile];


[mycueparser ParseCueFile:SelectedFileIs ];



NSString * albumArtist = [mycueparser RetMp3Performer];
[self.albumArtist setStringValue:albumArtist];

NSString * album = [mycueparser RetMp3Title];
[self.albumTitle setStringValue:album];

//[self.genreTypeList setValuesForKeysWithDictionary:<#(NSDictionary *)#>]
}

@end
14 changes: 14 additions & 0 deletions PodcastCutter/PodcastCutter/CueParser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// CueParser.h
// PodcastCutter
//
// Created by Arthur Belous on 07.12.12.
// Copyright (c) 2012 Arthur Belous. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CueParser : NSObject

-(void) ParseCueFile:(NSString *)Filepath;
@end
80 changes: 80 additions & 0 deletions PodcastCutter/PodcastCutter/CueParser.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//
// CueParser.m
// PodcastCutter
//
// Created by Arthur Belous on 07.12.12.
// Copyright (c) 2012 Arthur Belous. All rights reserved.
//

#import "CueParser.h"
#import "Mp3Arrays.h"


@implementation CueParser

-(void) ParseCueFile:(NSString*)fileLocationPath
{
Mp3Arrays * ma = [[Mp3Arrays alloc] init];
NSError *error = nil;
NSString * cueFile = [NSString stringWithContentsOfFile:fileLocationPath encoding:NSUTF8StringEncoding error:&error];
NSArray* arrayOfLines = [cueFile componentsSeparatedByString:@"\n"];
for (int s = 0; s < 4; s ++)
{
NSString * WordsInLine = [arrayOfLines objectAtIndex: s];

char c = '"';
NSString *separator = [NSString stringWithFormat:@"%c", c];
NSArray * WordsInLineNntoArray = [WordsInLine componentsSeparatedByString:separator];
for (int v = 0; v< WordsInLineNntoArray.count; v++)
{
NSString *w = [WordsInLineNntoArray objectAtIndex:v];
NSString *withoutSpase = [w stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if ([withoutSpase hasPrefix:@"PERFORMER"])
{
NSString * tempPerformer = [WordsInLineNntoArray objectAtIndex:v+1];
[ma setAlbumPerformer:tempPerformer];
}
if ([withoutSpase hasPrefix:@"TITLE"])
{
NSString *tempTitle = [WordsInLineNntoArray objectAtIndex:v+1];
[ma setAlbumTitle:tempTitle];
}
}
for (int i = 3; i < arrayOfLines.count; i ++)
{
NSString * WordsInLine = [arrayOfLines objectAtIndex: i];

char s = '"';
NSString *separator = [NSString stringWithFormat:@"%c", s];
NSArray * WordsInLineNntoArray = [WordsInLine componentsSeparatedByString:separator];
for (int x = 0; x< WordsInLineNntoArray.count; x++)
{
NSString *w = [WordsInLineNntoArray objectAtIndex:x];
NSString *withoutSpase = [w stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if ([withoutSpase hasPrefix:@"PERFORMER"])
{

NSString * trackPerformer = [WordsInLineNntoArray objectAtIndex:x+1];
[ma insertIntoPerformerArray:trackPerformer];
}
if ([withoutSpase hasPrefix:@"TITLE"])
{
NSString * trackTitle = [WordsInLineNntoArray objectAtIndex:x+1];
[ma insertIntoTitelArray:trackTitle];
}
if ([withoutSpase hasPrefix:@"TRACK"])
{
NSString *trackArrayItem = [withoutSpase substringWithRange:NSMakeRange(6, 2)];
[ma insertIntoTrackArray:trackArrayItem];
}
if ([withoutSpase hasPrefix:@"INDEX"])
{
NSString *indexArrayItem = [withoutSpase substringFromIndex:10];
[ma insertIntoIndexArray:indexArrayItem];
}
}
}
}
}

@end
32 changes: 32 additions & 0 deletions PodcastCutter/PodcastCutter/Mp3Arrays.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// Mp3Arrays.h
// PodcastCutter
//
// Created by Arthur Belous on 05.01.13.
// Copyright (c) 2013 Arthur Belous. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Mp3Arrays : NSObject
{
NSMutableArray *arrayOfMp3Index;
NSMutableArray *arrayOfMp3Title;
NSMutableArray *arrayOfMp3Performer;
NSMutableArray *arrayOfMp3Track;
NSString * MP3Performer;
NSString * MP3Title;
}
-(void) insertIntoIndexArray:(NSString*) index;
-(void) insertIntoTitelArray:(NSString*) title;
-(void) insertIntoPerformerArray:(NSString*) performer;
-(void) insertIntoTrackArray:(NSString*) track;
-(void) setAlbumPerformer:(NSString*) albumPerformer;
-(void) setAlbumTitle:(NSString*) albumTitle;
-( NSMutableArray *) ReturnIndexArray;
-(NSMutableArray *) ReturnPerformerArray;
-(NSMutableArray*) ReturnTrackArray;
-(NSMutableArray*) ReturnTitleArray;
-(NSString*) RetMp3Performer;
-(NSString*) RetMp3Title;
@end
Loading