Archive for August, 2006

Working on the Podcast Worker

Currently working a lot on the podcast worker. As I’ve mentioned before, the worker will handle several things:

  • Cutting up a medie-file into smaller items
  • Adding the to a database
  • FTP’ing the media-files to an Anystream Transcoder
  • Analyzing the feedback from the Anystream Transcoder and make the items transcoded publicly available

Apart from that, I also need to create the websíte, where people chooses which categories (e.g. sports, news, regional) they wan’t to subscribe to. And of course create the engine that generates the RSS on demand.

Until now, I’m almost finished with the internal workflow (the parts that are invisible for the end user).

I’ve:

  • Used the FileSystemWatcher to guard, that files are not transfered to the Anystream Transcoder while they are still being written by the process that cuts the main file into smaller files
  • Created a data abstraction layer using stronly typed datasets (really like this) againt a MS-SQL-database
  • Created a FTP-program that contacts a webservice, which starts up the whole process

I’ve calculated, that 8 serveres are a part of this entire podcast-process (from mediafile/news-item to webserver). I do know, that a lot of you guys do very large projects – but to me, this is pretty heavy.

And most of all; I have to be extremely sure, that all errors are handled, as the process has to work perfectly without people “helping”.

I look forward to the day it works (which is about 11 days when we go into beta).

Comments

Tags Plugin – Windows Live Writer

Finished (or at least I think) the tags plugin for Windows Live Writer. Since the last build I:

  • Added an icon
  • Changed a few visual appearances
  • Packed the DLL into an MSI-installer package

Hope you like it. If you have any suggestions for features – don’t hesitate to contact me.

As always – the plugin can be found here.

Comments

Visual Basic .NET embedding resources and Windows Live Writer plugin

Finally figured out how to add an icon to my Multiple Tags Plugin. It turns out that, probably because I’m using visual basic .net, that the proces is somewhat different then that of C#.

However:

  1. Go to your project properties
  2. Go to Resources
  3. Select Add Resource
  4. Be sure to select "Add Existing File…"
  5. Browse to the location of your file and select open
  6. The file is added as a resource, and to your project, a resouce folder is added
  7. Go to the resource folder – expand it
  8. Click the image, goto properties, select Build Action and choose "Embedded Resource"
     ScreenHunter_25
  9. To add it to your Windows Live Writer Plugin add this to your WriterPluginAttribute: ImagePath:="Tags.png" (note: You should NOT add the folder)

Now build your project, and when opening Windows Live Writer, you should se the icon next to your plugin.

Comments

New release of Tags Plugin for Windows Live Writer

Have updated a few thins in the tags plugin for Windows Live Writer. I’ve added the option og getting the tags in your post in case you find they are missing (just press the button “Get Tags”. It’s required though, that the tags be inserted with the current version of the tags plugin.

As always – you can find it here.

However – I still have problems adding an image. I’ve tried creating a new project in C#, and it works right away. Tried creating a new project in VB.NET – doing the exact same things, as when creating the C# project – but Windows Live Writer fails to load the image when opening. Don’t know what’s wrong. Maybe I’ll just convert the whole thing to C#, or add it to the Tag4Writer.

Comments

Finding the duration of a Windows Media File

So, having spent the last 4-5 hours trying to find out how to extract the duration from a Windows Media File, I finally found a way to do it.

I have been through a lot – even trying to figure out how to convert at QWORD into somthing readable – but without luck.

Finally i stumbled upon a post in the forum on http://www.codeproject.com (excellent site) – which enabled me to create this function:

    ''' <summary>
    ''' Finds the duration of a specified windows media file using
    ''' a Windows Media Player Object
    ''' </summary>
    ''' <param name="MediaFile">MediaFila as reference to the file</param>
    ''' <returns>Double containing the length</returns>
    ''' <remarks></remarks>
    Private Function FindDurationWMF(ByVal MediaFile As String) As Double
        Try
            Dim myWMP As WindowsMediaPlayer = New WindowsMediaPlayer
            Dim str As String = MediaFile
            Dim duration As Double
            myWMP.URL = str
            myWMP.currentMedia.name = str
            duration = myWMP.currentMedia.duration
            myWMP.close()
            Return duration
        Catch ex As Exception
            Throw New Exception(ex.Message, ex.InnerException)
        End Try
    End Function

Remember to add a reference to the Windows Media Player DLL, and to import it at the top of your class.

The project I’m currently working on, is cutting a media-file up into smaller pieces (with shorter duration) using the Basic Edit function of Windows Media Encoder. The actual problem was, that the out-point specified in some situations ware just e.g. 100 miliseconds longer than the actual file, which caused the appliction to break.

Comments

Changing the encoding of a textfile

Sometimes it would be a lot easier, if english were the only language – this would really make it easier to be a programmer working with files and encoding.

I’m currently programming some sort of podcast-application, and for this, I have to read a textfile, that contains information about the videos to cast. But, when I read the text from the file into my textbox, I missed a lot of characters… All the danish characters.

Therefore I created a small function to change the encoding from (in my case ANSI) to UTF-8.

If there are better ways to do this – then please let me know. I don’t know if it works for large files, but for the small files I’m working with, it works great.

 

    ''' <summary>
    ''' Chaging the encoding of a file
    ''' </summary>
    ''' <param name="InputFile">Takes a reference to the inputfile as a string (location)</param>
    ''' <returns>A string with a reference to the new file</returns>
    ''' <remarks></remarks>
    Private Function ChangeEncoding(ByVal InputFile As String) As String
        Try
            'Opening a textreader to hold the content of the file in default encoding.
            Dim input As TextReader = New StreamReader(New FileStream(InputFile, FileMode.Open), Encoding.Default)
            'Generating af new filename
            Dim strFile As String = Path.GetFileNameWithoutExtension(Path.GetRandomFileName).ToString & ".txt"
            'Writing the text to a new file
            My.Computer.FileSystem.WriteAllText(My.Settings.TxtRootFolder & "\" & strFile, input.ReadToEnd, False)
            'Closing the input-file
            input.Close()
            'Deleting the original file
            If My.Computer.FileSystem.FileExists(InputFile) Then
                My.Computer.FileSystem.DeleteFile(InputFile)
            End If
            'Returning the name of the new file to the caller
            Return strFile.ToString
        Catch ex As Exception
            'Trowing an exception back to the caller
            Throw New Exception(ex.Message, ex.InnerException)
            Return String.Empty
        End Try
    End Function

 

Technorati: , , ,

Comments

Update to Multiple Tags Plugin for Windows Live Writer

Just finished my update to the Multiple Tags Plugin for Windows Live Writer. I figured out, that it would be nice to have the option to edit the tags, that were put into the post.

It took me quite a while to figure out how to do this – but, after reading some blogs on the Internet, and looking at the SourceCode-plugin for Writer, I figured out, that the SmartContent object was the way to go.

So after some programming and codechanges, I ended up with something that works. It’s not perfect – and it still needs modifications – but, for now it’s all-right. And I have to get to bed, as the time is 11:55 pm in Denmark.

The updated plugin can be found here.

Comments

Playing around with Membershop & Roles

Hm… Thought I’d give Membershop & Roles in ASP.NET a try. Think I’ll be working on a small web-application that enables people to register and save their information on their use of electricity, gas, water and heat. I always gets my paper with the info thrown away.

Apart from that, we had a bit of a network break-down at work today. I was trying to track down a computer that had been using the FTP proctocol for the whole day – and as trying to do that – I thought I’d check out one of our HP ProCurve switches. But, for some reason, while the switch was loading the java-application – I suddenly lost network – and so did the rest of the house… Bad luck.

But, it made me remember, how crucial the network infrastructure is for our company. Because event though the break down was only 30 seconds or so – we had problems on and off for the next couple of hours.

I’ll be hoping for a better day tomorrow.

Technorati: , ,

Comments

Windows Live Writer – Plugin (tags) – Images

I must say, that I still like Windows Live Writer after having played around with it for a while. And after having added a couple of plugins, it’s actually very great. Works perfectly with my WordPress blog.

However – I’ve been trying to add a image to my Tags-plugin – but have’nt figured out how. I think, that I’m doing it the right way – but apparently not – the program (during startup) keeps complaining, that it can’t find the referenced file in the directory (Images.Name.png) – even though I have added it to that directory as a embedded ressource.

If any have any suggestions – feel free to let me know.

Technorati: , , ,

Comments (3)

TagsPlugin for Windows Live Writer – Finished BETA

Okay… I think I finished the BETA version of the TagsPlugin for Windows Live Writer.

I’ve added:

  • The ability to save changes to a tag-template
  • Corrected a path-error
  • Corrected some trimming

The plugin can be found here.

Technorati: , ,

Comments

« Previous entries Next Page » Next Page »