History of iTunes Store music previews

2014-05-19 Thread Madhavi Gundeti
Hi,

Is there any way to save iTunes Store music/video preview history on my
Macintosh Music Library?

I am developing one Mac application to save the history of played
music/video by user(including music/video previews).

But I observed iTunes Store is not saving music/video preview history of
Anonymous user.

How to save the iTunes store music/video preview history programmatically
into Mac Music Library? Is it possible ?

Thanks and Regards,
Madhavi G.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: iTune Plist changes from NSUserdefaults

2014-01-12 Thread Madhavi Gundeti
Hi Jens,

Now I developed UI application to perform the iTunes preferences changes.

I installed my application on Mountain Lion.when I upgraded OS version from
Mountain Lion to Mavericks 10.9.1 my application freezes.
And I took Sampling process in Activity monitor. Below is the output.

-
Sort by top of stack, same collapsed (when >= 5):
__psynch_cvwait  (in libsystem_kernel.dylib)6169
__workq_kernreturn  (in libsystem_kernel.dylib)5609
mach_msg_trap  (in libsystem_kernel.dylib)3181
kevent64  (in libsystem_kernel.dylib)1565
__recvfrom  (in libsystem_kernel.dylib)722
start_wqthread  (in libsystem_pthread.dylib)82
__psynch_mutexwait  (in libsystem_kernel.dylib)77
objc_msgSend  (in libobjc.A.dylib)51
CFRelease  (in CoreFoundation)29
szone_free  (in libsystem_malloc.dylib)28
tiny_malloc_from_free_list  (in libsystem_malloc.dylib)28
_kernelrpc_mach_port_insert_member_trap  (in
libsystem_kernel.dylib)17
szone_malloc_should_clear  (in libsystem_malloc.dylib)16
OSSpinLockLock  (in libsystem_platform.dylib)15
pthread_threadid_np  (in libsystem_pthread.dylib)15
__psynch_mutexdrop  (in libsystem_kernel.dylib)14
bool objc::DenseMapBase >, objc_object*, unsigned long,
objc::DenseMapInfo,
true>::LookupBucketFor(objc_object* const&,
std::__1::pair const*&) const  (in
libobjc.A.dylib)14
szone_free_definite_size  (in libsystem_malloc.dylib)14
__mtx_droplock  (in libsystem_pthread.dylib)13
CFRetain  (in CoreFoundation)12
OSAtomicCompareAndSwap32Barrier$VARIANT$mp  (in
libsystem_platform.dylib)12
__CFBasicHashDrain  (in CoreFoundation)12
szone_size  (in libsystem_malloc.dylib)12
CFBasicHashGetCountOfKey  (in CoreFoundation)11
CFEqual  (in CoreFoundation)11
mk_timer_arm  (in libsystem_kernel.dylib)11
syscall_thread_switch  (in libsystem_kernel.dylib)11
OSAtomicCompareAndSwap64Barrier$VARIANT$mp  (in
libsystem_platform.dylib)10
__CFStringHash  (in CoreFoundation)9
_platform_memmove$VARIANT$sse42  (in
libsystem_platform.dylib)9
_pthread_mutex_check_init  (in libsystem_pthread.dylib)9
tiny_free_list_add_ptr  (in libsystem_malloc.dylib)9
CFBasicHashCreateCopy  (in CoreFoundation)8
_Block_copy_internal  (in libsystem_blocks.dylib)8
_pthread_mutex_lock  (in libsystem_pthread.dylib)8
CFAllocatorDeallocate  (in CoreFoundation)7
CFBasicHashAddValue  (in CoreFoundation)7
CFGetAllocator  (in CoreFoundation)7
_OSSpinLockLockSlow  (in libsystem_platform.dylib)7
_platform_bzero$VARIANT$sse42  (in libsystem_platform.dylib)
7
stat$INODE64  (in libsystem_kernel.dylib)7
CFBasicHashFindBucket  (in CoreFoundation)6
WTF::fastMalloc(unsigned long)  (in JavaScriptCore)6
_CFRetain  (in CoreFoundation)6
_CFRuntimeCreateInstance  (in CoreFoundation)6
__CFStringEncodeByteStream  (in CoreFoundation)6
__commpage_gettimeofday  (in libsystem_kernel.dylib)6
objc_clear_deallocating  (in libobjc.A.dylib)6
CFHash  (in CoreFoundation)5
OSSpinLockUnlock  (in libsystem_platform.dylib)5
WTF::fastFree(void*)  (in JavaScriptCore)5
_CFURLInitWithURLString  (in CoreFoundation)5
__getpid  (in libsystem_kernel.dylib)5
get_tiny_previous_free_msize  (in libsystem_malloc.dylib)5
pthread_mutex_unlock  (in libsystem_pthread.dylib)5
-

If  I uninstall my application and reinstall again then no problem.But Why
My application is freezing after upgrade from mountain lion to mavericks
10.9.1

*?.*

*And there was no problem when I upgraded My MacBookPro from Mountain Lion
to Mavericks 10.9 version.*


Thanks and Regards,
Madhavi G.


On Wed, Dec 25, 2013 at 1:15 AM, Jens Alfke  wrote:

>
> On Dec 23, 2013, at 10:58 PM, Madhavi Gundeti 
> wrote:
>
> I am developing a daemon which runs as root
>
>
> That’s not recommended, because the daemon will have the ability to do all
> kinds of bad things. A bug could destroy someone’s system, or worse, a
> security hole in your code could let an attacker take over the OS.
>
> It’s best to follow the “Principle of least privilege”: run the daemon as
> a separate account and give that account only the privileges it needs. Or
> run as an agent process under the current user’s account. Apple has a tech
>

Re: iTune Plist changes from NSUserdefaults

2013-12-23 Thread Madhavi Gundeti
I am developing a daemon which runs as root, so I wanted to change the user
defaults from the daemon. Now I got it, It  is not possible with
NSUserdefaults.

So I found another way to do that. I created another application which is
called by this daemon and the application will do the job what exactly I
want.

Thank you so much for your reply again :)



Thanks and Regards,
Madhavi G.


On Tue, Dec 24, 2013 at 11:35 AM, Jens Alfke  wrote:

>
> On Dec 23, 2013, at 9:32 PM, Madhavi Gundeti 
> wrote:
>
> But Is there any way to change other user defaults as root user??
>
>
> I don’t know. Look at CFPreferences; it has more options than
> NSUserDefaults.
> Is there a reason you have to do this as root, rather than the user whose
> prefs are being altered?
>
> —Jens
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: iTune Plist changes from NSUserdefaults

2013-12-23 Thread Madhavi Gundeti
Hi Jens,

Thank you so much for the reply.
But Is there any way to change other user defaults as root user??


Thanks and Regards,
Madhavi G.


On Mon, Dec 23, 2013 at 4:39 AM, Jens Alfke  wrote:

>
> On Dec 11, 2013, at 4:45 AM, Madhavi Gundeti 
> wrote:
>
> Please let me know what I am missing here. Why I am not able to change
> these settings as root user.
>
>
> Because every user has their own defaults. If you use NSUserDefaults in a
> process whose userid is root, you’re changing the defaults of the ‘root'
> account, not a real user.
>
> —Jens
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

iTune Plist changes from NSUserdefaults

2013-12-22 Thread Madhavi Gundeti
Hi,

I am developing one MAC application to change iTunes Parental control
setting programmatically.

I am using NSUserdefaults class to achieve above. Please find the sample
code.

#define kBundleIdentifier @"com.apple.iTunes"


NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];



NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];



NSDictionary *defaultPreferences1 = [defaults persistentDomainForName:
kBundleIdentifier];

[defaults synchronize];


NSMutableDictionary *mprefs = [defaultPreferences1 mutableCopy];




[mprefs setValue:@"YES" forKey:@"restrictExplicit"];

[mprefs setValue:@"YES" forKey:@"restrictMovies"];

[mprefs setValue:@"200" forKey:@"moviesLimit"];

[mprefs setValue:@"YES" forKey:@"restrictTVShows"];

[mprefs setValue:@"400" forKey:@"tvShowsLimit"];

[mprefs setValue:@"YES" forKey:@"restrictGames"];

[mprefs setValue:@"200" forKey:@"gamesLimit"];


[defaults removePersistentDomainForName:kBundleIdentifier];

[defaults synchronize];



//Adding modified Prefs

[defaults setPersistentDomain:mprefs forName:kBundleIdentifier];

[defaults synchronize];


I have a daemon running as root user.But root user unable to set the iTunes
preferences.

When I run the above code as login user then the iTune parent control
settings got changed.

Please let me know what I am missing here. Why I am not able to change
these settings as root user.

I tried one more method also:

 NSString *usrPlistPath =
@"/Users/madhavi/Library/Preferences/com.apple.iTunes.plist";

NSLog(@"Madhavi usrPlistPath is %@", usrPlistPath);




NSDictionary *defaultPreferences = [NSDictionary
dictionaryWithContentsOfFile:usrPlistPath];

[defaults registerDefaults:defaultPreferences];

[defaults synchronize];



[defaults  setBool:YES forKey:@"restrictExplicit"];

[defaults  setBool:YES forKey:@"restrictMovies"];

[defaults  setBool:YES forKey:@"restrictTVShows"];

[defaults  setBool:YES forKey:@"restrictGames"];



[defaults  setInteger:200 forKey:@"moviesLimit"];

[defaults  setInteger:400 forKey:@"tvShowsLimit"];

[defaults  setInteger:200 forKey:@"gamesLimit"];



[defaults synchronize];



With the above code I am able to create Userdefaults as root user, but
these values are not reflecting in plist. so that iTune preferences also
not getting changed.


It would be helpful to me if you provide any clue on above.


How to change iTunes plist using NSUserdefaults as root user.(Because I
don't want to change plist file directly)


Please suggest me on this.



Thanks and Regards,
Madhavi G.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com