Log in

No account? Create an account

Previous Entry | Next Entry

iTunes AutoDetect

If you begin an entry with an LJ-Cut, LJ-User, Image, or Link tag using iJournal's shortcuts (i.e. not manually typing the tags out, using apple-k, apple-u, etc.), iJournal will not automatically detect what is currently playing in iTunes 2.


( 10 comments — Leave a comment )
Mar. 23rd, 2002 06:59 am (UTC)
...since I can't seem to edit this entry, it should be (i.e. not manually typing the tags out; instead, using apple-k, apple-u, etc.) for clarification.
Mar. 23rd, 2002 07:00 am (UTC)
same if you cut and paste the first bit of the entry in
(Deleted comment)
Mar. 23rd, 2002 11:46 am (UTC)
If that notification is found, it might be helpful for dealing with line endings. I'm now in the habit of doing a replace all for \r, \r\n when I want to paste something into iJournal. Kind of a drag, but I get by.
Mar. 23rd, 2002 12:17 pm (UTC)
textDidChange: does work with cut and paste... it's just that in iJournal the music update thing in this context only gets called when there's only 1 character in the submission field.
(Deleted comment)
Mar. 23rd, 2002 02:45 pm (UTC)
line endings
If the line endings are not \r\n (I haven't tried \n alone) then <br> tags are not inserted and, if you then edit the post, you will get back a single block of text rather than the formatted text you pasted. If I, for example, copy your message above from IE, paste it into iJournal and post it will lose all formatting. Switching the line endings from \r to \r\n causes preservation of formatting.

If no one else is experiencing this, I must be going out of my mind.

Mar. 23rd, 2002 08:29 pm (UTC)
Re: line endings
Wow. I didn't know there was a workaround. Thanks for the info! (I have heard others complain of this behavior, too)
Mar. 23rd, 2002 12:08 pm (UTC)
- (void)textDidBeginEditing:(NSNotification *)aNotification

Does what you want but you'd need to reset the textfield on submit.

Closing the window does this but there's probably a more elegant way of doing it.

Also it will update the music field when editing the last entry if they haven't done any editing before that, so the user loses the song that was in their entry so there'd need to be some way to disable it in those situations.

I've got some ideas on how to get around this so I might hack out a patch...
(Deleted comment)
Mar. 23rd, 2002 06:37 pm (UTC)
I'll split this message into two bits. Information and Opinions... you can ignore the opinions bit if you want :)


The problem is that textShouldBeginEditing: only gets called once (Put some debug statements in and see) it's the same deal with textDidBeginEditing.

So if you submit an entry it won't call textShouldBeginEditing: at start of the next entry since you're still using the same textview. Closing and re-opening the window will reset the text view.

Also the solution you've got doesn't solve the various "Make Link" cases not calling iTunes that the original poster mentioned.

textDidBeginEditing: does get called when those menu items are called.

Opinion :

And giv en that the general idea is to just call iTunes and get what music is playing when someone starts editing it seems to make more sense to just call iTunes whenever someone begins editing in the TextView.

Kinda like this:

I've kinda forked the codebase at home and written my own is isReposting method so using this code isn't a straight cut and paste job, but you can see the program logic.

- (void)textDidBeginEditing:(NSNotification *)aNotification
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
#ifdef __DEBUG__
    if([[defaults stringForKey: @"autodetectMusic"] isEqual: @"1"] && ![controller isReposting])
        [proxy updateMusic: self];
#ifdef __DEBUG__
        NSLog(@"Preferences say don't auto-detect or the current entry is a reposting");

It still however suffers from the same problem that the TextView isn't reset on submit so it's never called in subsequent submissions.
Mar. 23rd, 2002 06:54 pm (UTC)
Doh, I just discovered that whatever textDidBeginEditing polls is reset if you move off the TextView
so half of what most of what I said is only relevant if you're me and never type anything in any other fields...

You only get that problem I was talking about if you never move off the TextView (as in start typing the next entry straight off without entering a subject.

You still probably want to reset the entries TextView by making the subject field where the cursor starts after someone submits an entry.
(Deleted comment)
Mar. 24th, 2002 05:03 am (UTC)
Cool, that all makes sense....

I think I get how all this works now...

But anyway if you submit something and you're in the main textview even it never moves off it even when it's clearing all the fields so it never loses the firstresponder status so textShouldBeginEditing: doesn't get called.

Try entering something hitting submit (and all the fields get cleared) but then when you start entering text in the empty field the autodetect doesn't kick in.

Sorry to be so brief but I have an aweful hangover...
( 10 comments — Leave a comment )


iJournal: Official LiveJournal Client for Mac OS X
iJournal Home

Latest Month

June 2011

Page Summary

Powered by LiveJournal.com
Designed by Lilia Ahner