SOL9 2.0 Class: WMPMetadataText

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * WMPMetadataText.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL9
// 2011/12/07

#pragma once

#include <sol/wmp/WMPObject.h>
#include <sol/HTMLEncoder.h>

namespace SOL {

class WMPMetadataText :public WMPObject 
{
private:
    IWMPMetadataTextPtr text;

public:
    WMPMetadataText(IWMPMetadataTextPtr ptr)
    :text(ptr)
    {
        if (ptr == NULL) {
            throw NullPointerException("IWMPMetadataTextPtr is NULL", 0);
        }
    }

public:
    ~WMPMetadataText()
    {
        text = NULL;
    }

    _bstr_t getDescription ( )
    {
        return text ->GetDescription ( );
    }

    _bstr_t getText ( )
    {
        return text ->Gettext ( );
    }

public:
    virtual void showProperties(HWND hwnd=NULL) 
    {
        _tprintf(_T("<MetadataText>\n"));
        _bstr_t desc = getDescription();
        _bstr_t txt =  getText();
        _bstr_t bdesc;
        _bstr_t btxt;
        HTMLEncoder encoder;
        encoder.encode(desc, bdesc);
        encoder.encode(txt, btxt);
        _tprintf(_T("<Description>%s</Description>\n"), (const TCHAR*)bdesc);
        _tprintf(_T("<Text>%s</Text>\n"), (const TCHAR*)btxt);

        _tprintf(_T("</MetadataText>\n"));
    }
public:
    virtual void writeProperties(Writer& writer) 
    {
        writer.writeln(L"<MetadataText>");
        _bstr_t desc = getDescription();
        _bstr_t txt =  getText();
        _bstr_t bdesc;
        _bstr_t btxt;
        HTMLEncoder encoder;
        encoder.encode(desc, bdesc);
        encoder.encode(txt, btxt);
        writer.writeln(L"<Description>%s</Description>", (const wchar_t*)bdesc);
        writer.writeln(L"<Text>%s</Text>", (const wchar_t*)btxt);

        writer.writeln(L"</MetadataText>");
    }
};

}

Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.