Join/Login

Business Software

Open Source Software

For Vendors

Blog

About

More

Articles

Create

SourceForge Podcast

Site Documentation

Subscribe to our Newsletter

Support Request

For Vendors Help Create Join Login

Business Software

Open Source Software

SourceForge Podcast

Resources

Articles

Case Studies

Blog

Menu

Help

Create

Join

Login

Home

Browse

PlayerPro music editor and SoundTracker

Code

PlayerPro music editor and SoundTracker Code

Play SoundTracker media on your computer.

Brought to you by: madd_the_sane, rossetantoine, sandrobilbeisi

Summary

Files

Reviews

Support

Mailing Lists

Tickets ▾

Bugs

Support Requests

Patches

Feature Requests

News

Discussion

Code

Menu ▾ ▴

Browse Commits

Fork

Merge Requests 0

Branches

master

Classic

NSPreferences

PP5-CPlusPlusRewrite

PPPcmd

PlayerPRO5

SDLAudio

XPCMIDI

XPCMIDI-noObjC

audioToolbox-plugrewrite

More Branches

Tags

5.10-Developer-Preview-1

5.10-Developer-Preview-2

5.10-Developer-Preview-3

5.10-Developer-Preview-4

5.10-Developer-Preview-5

5.10-Developer-Preview-6

5.10-Developer-Preview-7

PP6-pre_split

PPlayer-1.0

PPlayer-1.0.1

More Tags

[d57ebb]: / PlayerPRO 6 / Plug-ins / Digital Plugs / Fade Note / FadeNoteController.m  Maximize  Restore  History

Download this file

106 lines (86 with data), 2.7 kB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

//

// FadeNoteController.m

// PPMacho

//

// Created by C.W. Betts on 9/10/13.

//

//

#import "FadeNoteController.h"

#import <PlayerPROKit/PlayerPROKit.h>

#define kNoteCompareOptions (NSCaseInsensitiveSearch | NSWidthInsensitiveSearch | NSDiacriticInsensitiveSearch)

static inline short NSStringToNote(NSString *myTT)

{

return [PPSampleObject noteFromString:myTT];

}

@implementation FadeNoteController

@synthesize thePcmd;

#if 0

- (instancetype)initWithWindow:(NSWindow *)window

{

if (self = [super initWithWindow:window]) {

// Initialization code here.

}

return self;

}

#endif

- (void)windowDidLoad

{

[super windowDidLoad];

// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.

[self.toBox removeAllItems];

[self.fromBox removeAllItems];

for (int i = 1; i < 96; i++) {

NSString *str = [PPSampleObject octaveNameFromNote:i];

[self.toBox addItemWithObjectValue:str];

[self.fromBox addItemWithObjectValue:str];

}

[self.toBox selectItemWithObjectValue:self.initialTo];

[self.fromBox selectItemWithObjectValue:self.initialFrom];

}

- (BOOL)validateSettings;

{

NSString *tB, *fB;

tB = [self.toBox stringValue];

fB = [self.fromBox stringValue];

if (NSStringToNote(tB) == 0xFF || NSStringToNote(fB) == 0xFF) {

return NO;

} else {

return YES;

}

}

- (IBAction)okay:(id)sender

{

if (![self validateSettings]) {

NSBeep();

NSAlert *badSettings = [[NSAlert alloc] init];

badSettings.messageText = @"Invalid Value";

badSettings.informativeText = @"There is one or more invalid value.";

[badSettings addButtonWithTitle:@"OK"];

[[self window] beginCriticalSheet:badSettings.window completionHandler:^(NSModalResponse returnCode) {

//

}];

} else {

short from, to;

Cmd *myCmd;

from = NSStringToNote([self.fromBox stringValue]);

to = NSStringToNote([self.toBox stringValue]);

NSAssert(from != 0xFF && to != 0xFF, @"We should have checked for valid values already!");

for (short track = 0; track < thePcmd->tracks; track++) {

for (short row = 0; row < thePcmd->length; row++) {

myCmd = MADGetCmd(row, track, thePcmd);

if (thePcmd->length > 1) // no zero div !!

myCmd->note = from + ((to-from) * row) / (thePcmd->length - 1);

// my fade command : 0x10 min vol, 0x50 : max vol

// Refer to MAD description for more informations

}

}

[_parentWindow endSheet:self.window];

_currentBlock(nil);

}

}

- (IBAction)cancel:(id)sender

{

[_parentWindow endSheet:self.window];

_currentBlock([NSError errorWithDomain:PPMADErrorDomain code:MADUserCancelledErr userInfo:nil]);

}

@end

SourceForge

Create a Project

Open Source Software

Business Software

Top Downloaded Projects

Company

About

Team

SourceForge Headquarters
225 Broadway Suite 1600
San Diego, CA 92101
+1 (858) 422-6466

Resources

Support

Site Documentation

Site Status

SourceForge Reviews

© 2025 Slashdot Media. All Rights Reserved.

Terms Privacy Opt Out Advertise

×
Want the latest updates on software, tech news, and AI?

Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.

Submit