Sunday, March 04, 2012

Cifrar vs Encriptar eis a questão

Desde os tempos  de faculdade que aprendi com o Prof. Legatheaux que não é correcto utilizarmos um inglesismo quando existe um termo em Português que significa a mesma coisa, ou seja, não é correcto utilizar Encriptar quando temos o Cifrar. Desde essa altura que tenho feito este reparo a diversas pessoas quando utilizam o termo Encriptar.
 Recentemente encontrei novamente o termo Encriptar na revista Exame Informática e decidi indagar mais a fundo sobre a correcta utilização do mesmo. Encontrei no Ciberdúvidas algumas referências ([aqui] e [aqui]) a esta questão mas as respostas não são claras. Encontrei também uma definição da palavra Encriptar na Infopedia. Contactei novamente com o Prof. Legatheaux e coloquei a questão da banalização do termo e as repostas pouco claras dadas pelo Ciberdúvidas e a existência da palavra na Infopedia e outros dicionários.
 O Prof. ajudou no aprofundar e clarificar da questão tendo indicado que no Dicionário da Academia das Ciências de Lisboa elaborado pelo Instituto de Lexicologia e Lexicografia da Academia, com suporte da Gulbenkian, do Instituto Camões e do Ministério da Educação  (edição de 2001) não há lá o termo “encriptar”. Referiu também que no mesmo dicionário há muitos termos estrangeiros como por exemplo “body building” que é um sinónimo de culturismo (sic), “abat-jour” entre outros.Termos relacionados com criptografia e que se encontram no dicionário da Academia:
cripto-* com origem em oculto
criptografia
criptográfico
criptograma
criptologia
cifrar
cifra
cifrado
decifrar
decifração
decifrador
decifrável
Concluindo, apesar de estar a ficar banalizada a utilização do termo Encriptar e da mesma existir em alguns dicionários generalistas, o termo não se encontra no dicionário de referência na área. Assim, e para os mais puristas, o mais correcto é utilizar Cifrar e não o Encriptar.

Tuesday, July 19, 2011

Salt Lake City to Denver natural parks trip

UsaTripMap2UsaTripMap

10 days, 15 natural parks,  2247 miles (~3616 km), between July  8th and 17th 2011)

Day 1

  • Flight to Salt Lake City, Drive to Wendover

Day 2

Day 3

Day 4

Day 5

Day 6

Day 7

  • Black Canyon and did the Gunnison hike to the bottom … ufff

Day 8

Day 9

Day 10

(trip planned and mapped with Microsoft Streets and Trips)

Wednesday, February 16, 2011

The Boss Who Breaks All the Rules

Presented a talk at the Scrum Gathering Portugal 2011 called “The Boss Who Breaks All the Rules

http://www.slideshare.net/tiagonmas/the-boss-who-breaks-all-the-rules

"For 25 years, Ricardo Semler  has been putting into practice what increasing numbers of modern management gurus are now preaching. He heads a democratic company, Semco, where employees set their hours, determine their salaries and choose their bosses. In this session we will talk about the main management changes that Semco introduced, which are very aligned with the agile mindset. We’ll also hear from managers of five companies on their real and concrete experience in putting some of these concepts in practice.

Invited speakers for this session: Rui Pedro Alves (Partner at Rupeal), Jurgen Appelo (Book author “Management 3.0”), João Pedro Martins (CTO at Create.IT), Alexandre Magno (Principal at AdaptWorks) and Miguel Muñoz Duarte (Partner at Imatch)
"

Friday, August 06, 2010

Videos das apresentações no Ignite Portugal

Desde a primeira edição que achei a ideia do Ignite bastante interessante. Foi orador no primeiro Ignite, virei colaborador da iniciativa, e fiz mais algumas apresentações. Recentemente foram publicados os vídeos de algumas destas sessões, nomeadamente duas que eu apresentei:

"Como galinhas e porcos nos podem ajudar a gerir projectos tecnológicos"
É com este título curioso que Tiago Andrade e Silva nos brinda com a versão 2.0 deste talk. Segundo ele há que mudar o paradigma de gestão de projectos, tornando-os mais ágeis e adaptáveis, dando empowerment às equipas, de forma a conseguir melhores resultados e ir mais facilmente ao encontro da satisfação dos clientes. Escusado será dizer que nos dias turbulentos que correm, isto é ainda mais importante.
ver o video >>

Justiça Premium
"Tiago Andrade e Silva, um habitué do Ignite Portugal, traz-nos nestetalk um tema que muitos consideram polémico: Justiça Premium. Segundo poderiam começar a haver alternativas de tribunais privados, à semelhança do que já existe na Saúde e na Educação. Isto iria trazer vantagens a todos, pois acelerava, por um lado, os processos, e escoava muitos casos dos Tribunais públicos, por outro, fazendo com que todo o sistema fluísse de uma forma muito mais eficaz."
 ver vídeo >> 

Tradução do Manifesto para o Desenvolvimento Ágil de Software

Foi recentemente terminada a tradução para Português do Manifesto Ágil a qual tive o prazer de liderar. Obrigado a todos pela revisão e envio de sugestões.
A versão final pode ser vista em http://www.agilemanifesto.org/iso/ptpt/

Excerto do manifesto:


Manifesto para o Desenvolvimento Ágil de Software

Ao desenvolver e ao ajudar outros a desenvolver software,
temos vindo a descobrir melhores formas de o fazer.
Através deste processo começámos a valorizar:

Indivíduos e interacções mais do que processos e ferramentas
Software funcional mais do que documentação abrangente
Colaboração com o cliente mais do que negociação contratual
Responder à mudança mais do que seguir um plano

Ou seja, apesar de reconhecermos valor nos itens à direita,
valorizamos mais os itens à esquerda. 

Monday, July 26, 2010

Bitocast - A hybrid BitTorrent and IP Multicast content distribution solution

Delivered and fininshed in January 2010 my Master thesis in Computer Science.

Master in computer science for Universidade Nova de Lisboa - Faculdade de Ciências e Tecnologia - Departamento de Informática

Abstract of the Master thesis:
In recent years we have observed an increased use of the Internet as a means for transmitting
large content. There have been several technology attempts to attack this problem, including
costly distribution networks and, more recently, peer to peer (P2P) protocols. Amongst
these P2P protocols, BitTorrent has proven itself as an effective means for transmitting large
content items and today enjoys great popularity.

Numerous researchers have analyzed BitTorrent and proposed concepts and models to enhance
its reliability, efficiency and fairness. Further, there are proposals to extend BitTorrent
to support on-demand multimedia streaming. In this Dissertation we present Bitocast, a
content distribution system that combines IP Multicast and BitTorrent protocols in order to
achieve a more efficient usage of an Internet Service Provider’s network and reduce download
time when serving large sets of contents to large audiences.

Download Bitocast Master thesis available at
http://bit.ly/cE8a0a 
Presentation available at:
http://bit.ly/9jfde3

Thursday, July 15, 2010

Seminário: Como galinhas e porcos ajudam a gerir projectos de Marketing Digital

 

No passado dia 8 de Julho, apresentei um seminário sobre gestão de projectos com metodologias ágeis, no IPAM, no âmbito da Pós-Graduação em Marketing Digital.

clip_image001

 

SEMINÁRIO

Convite,

Pós Graduação / Executive Master em Marketing Digital

Tema: Como galinhas e porcos ajudam a gerir projectos de Marketing Digital

Tópicos a abordar:

Os problemas da gestão de projectos tradicional

Como gerir projectos de forma ágil

A framework Scrum

Orador: Tiago Andrade e Silva

Tiago Andrade e Silva é actualmente o Director Técnico do Grupo Fullsix Portugal, empresa especializada em Marketing Interactivo. Tem cerca de 14 anos de experiência na indústria de desenvolvimento e gestão de projectos de Software, em especial para a Web. É Mestre em Eng. Informática e pós graduado em Gestão de Empresas Tecnológicas.

Dia: 8 de Julho

Local: IPAM Lisboa, 3º Piso, Auditório

Horário: das 19H00 às 21h00

HTML5: A concorrência ao Flash dominante

Fui recentemente entrevistado telefonicamente para a Exame Informática de Julho, artigo “HTML5: A concorrência ao Flash dominante”
O artigo completo pode ser visto online  (pág 88). Claro que aquilo que dizemos é sempre um pouco alterado para o artigo, mas eis um excerto:

 
clip_image002[4]

Monday, May 10, 2010

FarSeer in Microsoft Surface

Last year (2009) I ported Farseer physics engine to Microsoft Surface. With that I was able to do same demo projects. You can see some of the videos of the apps [1], [2], [3], [4]. One of these sample projects was even shown at the keynote of Microsoft Dev Days 2009.

Since several people asked me for the source code, I'm putting it here, available for download. It was developed on older versions of farseer and of Surface sdk, but I was informed it is still working under current versions. If you download and use it, please be so kind as to leave a comment.

I talked with the people responsible for Farseer about the possibility of having Surface was one of the platforms, but their response was:

genbox: "... I don't see Microsoft Surface being the next huge gaming platform in the near future. :) If I include it in the source tree, a couple of people might download it and have good use of it, but I would also have to maintain the code. Every time I change the API in Farseer Physics each change must be implemented into the samples too - We are simply too few people (and don't have the hardware) to maintain a huge selection of samples on different platforms."



Wednesday, April 21, 2010

Tradução do Agile Manifesto (www.agilemanifesto.org) para Português!

A Agile Alliance iniciou um projecto de tradução do Manifesto Ágil para múltiplas línguas. Aceitar ficar como responsável pela tradução para Português. Quem tiver interesse em colaborar nesta tradução, pode dar a sua opinião online

Mais informações sobre o projecto

Tuesday, March 02, 2010

Scrum ganha visibilidade em Portugal

Entrevista para a semana informática sobre Scrum

http://www.semanainformatica.xl.pt/965/emp/100.shtml

Tuesday, December 15, 2009

Car trip from Phoenix to San Francisco


From Phenix to San Francisco car trip.
2210 miles (3556 km), 12 days (29 Nov to 9 Dec 2009).

Day 1
1 Phoenix [map, photos, info]
3. Sedona [map, photos, info]
4. Oak Creek Canyon [map, photos, info]
6. Navajo National Monument [map, photos, info]
7. Kayenta [map, photos, info]
8. Monument Valley [map, photos, info] 9. Page [map, photos, info]
Day 2
9.1 Horseshoe bend [map, photos, info]
9.2 Antilope Canyon [map, photos, info]
10. Grand Canyon National Park - South Rim [map, photos, info]
10.1 Helicopter tour [map, photos, info]
11. Peach Springs - Hualapai Lodge [map, photos, info]

Day 3,4
11.1 Havasu Falls 3 day Hike [map, photos, info]
Day 5
Return from Grand Canyon to Las Vegas
Hoover Dam [map, photos, info]
12. Las Vegas - Planet Hollywood [map, photos, info]
12.1 Cirque du Soleil - KA and "O" [map, photos, info]
Day 6
13. Beatty - Lunch [map, photos, info]
14. Death Valley - [map, photos, info]
14.1 Titus Canyon [map, photos, info]
14.2 North Crater [map, photos, info]
17. Bishop [map, photos, info]
Day 7
18. Mono Lake [map, photos, info]
21. Jackson [map, photos, info]
22. Yosemite - Evergreen [map, photos, info]
Day 8
22.1 Evergreen Yosemite tour [map, photos, info]
Day 9
23. Old Sacramento [map, photos, info]
24. Point Reyes [map, photos, info]
Day 10 and 11
25. San Francisco [map, photos, info]

Friday, October 16, 2009

"Como gerir projectos impossíveis com agilidade" - talk no 1º Ignite Portugal



Ontem, no 1º Ignite Portugal, fiz uma apresentação sobre as metodologias ágeis.





Ignite Portugal é um conjunto de eventos abertos à participação de todos que giram em torno de apresentações sobre temas como inovação, criatividade, empreendedorismo ou tecnologia, em que os apresentadores têm apenas 5 minutos para falar, com 20 slides que rodam automaticamente a cada 15 segundos.

A apresentação está no slideshare.



Mais detalhes aqui

Wednesday, September 09, 2009

BitmapEffects with WriteableBitmap

Folowing this post, here is another set of visual effects applied to a image. The effects are enabled by using the WriteableBitmap class of Silverlight 3.

Running Demo. Download of the source code.

Monday, September 07, 2009

“The world in 2015” – A world of content

Article writen for the newspaper Semanário Económico – outlook - (5 de Setembro de 2009) for the topic "The World in 2015". Article in Portuguese:

“Daqui a 6 anos estaremos em plena revolução ao nível de conteúdos, desde a produção e distribuição até ao seu consumo. Os conteúdos serão uma ‘commodity’, forçada pela sua desmaterialização e facilidade de acesso através das redes digitais, e a experiência de consumo será a componente fundamental.

A produção de conteúdos irá mudar. Aliás, está progressivamente a deixar de estar exclusivamente nas mãos das grandes editoras ou produtoras. Cada vez mais, qualquer pessoa pode ser o autor de um livro, de um filme ou de uma estação de rádio e facilmente disponibilizar esse conteúdo a quem quer que esteja interessado. As melhores bandas, os melhores escritores e produtores serão escolhidos directamente por nós, sem a interferência de grandes campanhas de marketing.

Mas o consumo de conteúdos também está a mudar. Estamos num ponto de inflexão onde deixaremos de consumir o que outros decidem para passarmos a ser nós próprios a decidir que conteúdos vamos consumir, quando e onde. Eu serei o editor da minha revista, as rádios tocarão a música que eu gosto, as televisões emitirão os meus programas favoritos e os filmes, mesmo ainda não os tendo visto, serão os que têm a maior probabilidade de eu gostar.

Já começamos a assistir a um movimento de convergência digital onde os formatos físicos estão a ser substituídos pelos digitais. As velhas fotografias são substituídas pelos álbuns no Flickr, os vinis e cd’s pelos mp3 no iTunes, os filmes de 8mm e vhs de família pelos filmes no Youtube, já para não falar das tradicionais cartas que foram substituídas pelo email e que em 2015 serão substituídos por aplicações mais interactivas como o Google Wave. Em 2015 haverá muito poucos formatos físicos. Não é a disquete, que essa já nem os jovens actuais sabem o que é. Refiro-me aos cds, dvds e eventualmente os livros tal como os conhecemos. Tudo passará a estar disponível na rede e através dela, a qualquer hora, a partir de qualquer sítio e em qualquer dispositivo. Porque razão é que eu tenho de pagar novamente os direitos de autor de um CD musical se o formato físico comprado se estragar e eu pretender um novo? Qual é a loja que recebe o meu CD antigo e me dá um novo cobrando apenas o custo do formato físico? A importância passa para os direitos de autor e deixa de ser a distribuição e produção.

Será possível assistir a um filme ao mesmo tempo que os meus amigos, comentado cada uma das cenas à medida que elas vão acontecendo estando, no entanto, cada um na sala de sua casa. A proximidade de comunicação vai ser muito maior apesar de estarmos fisicamente distantes. Os dispositivos estarão interligados na disponibilização da melhor experiência de consumo. Poderei estar a assistir a um concerto da minha banda preferida na televisão de casa, e ao ter de me deslocar para o carro a música segue sem interrupções para o meu ipod e passa do mesmo modo para a aparelhagem do carro sem qualquer corte de fluidez musical na troca dos dispositivos emissores.

Não acontecerá apenas uma mudança tecnológica mas sim industrial, cultural e social. Tal como dizia Charles Darwin, não são as espécies mais fortes ou mais inteligentes que sobrevivem mas sim aquela que tem uma maior capacidade de adaptação. As grandes empresas de media que não demonstrem capacidades de se adaptar desaparecerão do mercado. A batalha contra a troca ilegal de ficheiros na internet será ganha pelos prevaricadores e as empresas passarão a adaptar a sua oferta, não ao conteúdo em si, mas sim aos serviços e experiências dados para além do conteúdo. Todos temos a noção que, nos cinemas, o que dá lucro são as pipocas e não o filme em si!

Assim sendo, o grande dilema em 2015 será como é que os produtores de conteúdos irão ter dividendos para continuar a produzir. Como é que se evita sermos inundados por obras de amadores e não chegarmos a ver obras de profissionais pois não conseguem obter o sustento necessário? A experiência de consumo é a resposta. Para a indústria musical serão os concertos a dar essa experiência e a gerar retorno. Mais complicado será para os escritores ou produtores de filmes que terão que utilizar meios interactivos muito mais complexos. Mas isso é outra história…”

SemanarioEconomico_outlook_05.09.2009.mundo2015_tas

Wednesday, September 02, 2009

Sample WritableBitmap

the image to a random color. The image is being redraw regularly so it shows a notion of “rain”. Here is the initialization:

        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
{

Screen.Width
= ScreenWidth;
Screen.Height
= ScreenHeight;

//Criaco do object writablebitmap com o tamanho indicado.
bitmap = new WriteableBitmap(ScreenWidth, ScreenHeight);
//Indicao de qual o elemento que ira fazer a visualizao do writable bitmap.
Screen.Source = bitmap;

//registar o evento para fazer o render regular
CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
}


After initilization and on each frame we redraw the pixels randomly:

void CompositionTarget_Rendering(object sender, EventArgs e)
{
var index
= MaxScreen;

//Pintar cada pixel
while (--index > -1)
{
//cor aleatoria para cada pixel
var color = System.Convert.ToInt32(rnd.Next(0xffffff));
bitmap.Pixels[index]
= color > 0xffffff ? 0xffffff : color;
}

//força o bitmap a redesenhar
bitmap.Invalidate();
}


Regarding the XAML we use an image of a TV to give a more realistic effect:



    <Grid x:Name="LayoutRoot" Background="#FFFFFFFF">
<Image x:Name="tv" Source="tv.jpg" Margin="68,29.807,72,53.193" d:LayoutOverrides="Width, Height"/>
<Image x:Name="Screen" OpacityMask="{x:Null}" Margin="99,57,100,0" Opacity="1" VerticalAlignment="Top" Height="216" Width="390"/>
</Grid>


The result is:



clip_image002


You can download the source code here and the demo can be seen here.

We can also play with the mouse movement and make it create interferences on the TV. We need to capture the mouse movement event and act accordingly:

//Repaint the screen regularly
void CompositionTarget_Rendering(object sender, EventArgs e)
{
var index
= MaxScreen;

//Paint each bitmap pixel.
while (--index > -1)
{
if (index % (mouseLastPos.X/2 + mouseLastPos.Y/2)+rnd.Next(20) < 15)
bitmap.Pixels[index]
= 0xffffff;
//bitmap.Pixels[index] = Convert.ToInt32(mouseLastPos.X * mouseLastPos.Y+5000);
else
{
//Random color for each pixel.
var color = System.Convert.ToInt32(rnd.Next(0xffffff));
bitmap.Pixels[index]
= color > 0xffffff ? 0xffffff : color;
}
}

//force bitmap repaint
bitmap.Invalidate();
}

Final result can be seen here.

Microsoft Surface demos

I recently developed a series of tests and demos os Microsoft Surface to some clients and journalists. As a result there was some magazine coverage: Pc Guia, Bit (pg1 e pg2) and also a TV show "episódio 4 da Exame Informática TV" that was recorded at Fullsix and brodcasted by Sic Notícias.


The prototypes that I developed can be seen here. One of these prototypes was also showed at the keynote of Microsoft DevDays 09.

Wednesday, March 18, 2009

XAML PT community lauched

Today we lauch a new community that aims at Microsoft's Presentation Technologies: XAML PT. Namely the development of Silverlight, WPF and Surface applications that use XAML. The community is intended for Portuguese speaking people and will be formally released at the same time as the Keynote of MIX09 this afternoon (GMT).

I would like to thank Fullsix Portugal for sponsoring this community.

Saturday, February 21, 2009

Web site frontend performance

This week I presented at DevDays09 the session WUX303 – Optimização de Performance de Web Sites. This session had great feedback. It was ranked number 7 of the overall 75 sessions of the event.

It was an overview of the book “High Performance Web Sites” by Steve Souders. I presented the 14 rules and showed some demos and tools that help on optimizing your website.

Here are some of the tools I used:

Here are the slides of the presentation and the demos.

Sunday, February 15, 2009

Changing sound frequency for game

Hi!
I wanted to be able to change a sound frequency according to the strength applied to a element inside a game. Based on this thread I changed the sample to allow to change at real time the frequency of the sound being played.

The code that does the thing is:

   1: BufferDescription d = new BufferDescription();


   2: d.ControlFrequency = true;


   3: sound = new SecondaryBuffer("C:\\Windows\\Media\\ding.wav", d, applicationDevice);


   4: sound.Frequency = 0; //The default frequency


   5: sound.Play(0, BufferPlayFlags.Looping);


   6: if you want to change the frequency:


   7: sound.Frequency = <some value>;




Here is the complete code:



(you need to add a reference to Microsoft.DirectX.DirectSound)






   1: using System;


   2: using System.IO;


   3: using System.Drawing;


   4: using System.Collections;


   5: using System.ComponentModel;


   6: using System.Windows.Forms;


   7: using System.Data;


   8:  


   9: using Microsoft.DirectX.DirectSound;


  10:  


  11: namespace Noisey


  12: {


  13:     /// <summary>


  14:     /// Very simple test form


  15:     /// </summary>


  16:     public class MainForm : System.Windows.Forms.Form


  17:     {


  18:         private System.Windows.Forms.Button btnPlay;


  19:         /// <summary>


  20:         /// Required designer variable.


  21:         /// </summary>


  22:         private System.ComponentModel.Container components = null;


  23:  


  24:         Device applicationDevice;


  25:         SecondaryBuffer sound;


  26:         private BufferDescription d;


  27:  


  28:         private TrackBar trackBar1;


  29:         private TextBox txtFreq;


  30:         private Label label1;


  31:         private Label label2;


  32:         private Button btnStop;


  33:         private OpenFileDialog openFileDialog1;


  34:         private Button btnNewFile;


  35:         private Label lblFile;


  36:         private Label label3;


  37:         


  38:         


  39:  


  40:         public MainForm()


  41:         {


  42:             //


  43:             // Required for Windows Form Designer support


  44:             //


  45:             InitializeComponent();


  46:  


  47:             //


  48:             // Add any constructor code after InitializeComponent call


  49:             //


  50:             applicationDevice = new Device();


  51:             applicationDevice.SetCooperativeLevel(this, CooperativeLevel.Normal);


  52:             


  53:             d = new BufferDescription();


  54:             // Set descriptor’s flags


  55:             d.ControlPan = true;


  56:             d.ControlVolume = false;


  57:             d.ControlFrequency = true;


  58:             d.ControlEffects = false;


  59:  


  60:             //Load a default file


  61:             sound = new SecondaryBuffer("C:\\Windows\\Media\\ding.wav", d, applicationDevice);


  62:             sound.Frequency = 0; //The default frequency


  63:  


  64:             //Disable stop button because it's not playing yet.


  65:             btnStop.Enabled = false;


  66:         }


  67:  


  68:         /// <summary>


  69:         /// Clean up any resources being used.


  70:         /// </summary>


  71:         protected override void Dispose(bool disposing)


  72:         {


  73:             if (disposing)


  74:             {


  75:                 if (components != null)


  76:                 {


  77:                     components.Dispose();


  78:                 }


  79:             }


  80:             base.Dispose(disposing);


  81:         }


  82:  


  83:         #region Windows Form Designer generated code


  84:         /// <summary>


  85:         /// Required method for Designer support - do not modify


  86:         /// the contents of this method with the code editor.


  87:         /// </summary>


  88:         private void InitializeComponent()


  89:         {


  90:             this.btnPlay = new System.Windows.Forms.Button();


  91:             this.trackBar1 = new System.Windows.Forms.TrackBar();


  92:             this.txtFreq = new System.Windows.Forms.TextBox();


  93:             this.label1 = new System.Windows.Forms.Label();


  94:             this.label2 = new System.Windows.Forms.Label();


  95:             this.btnStop = new System.Windows.Forms.Button();


  96:             this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();


  97:             this.btnNewFile = new System.Windows.Forms.Button();


  98:             this.lblFile = new System.Windows.Forms.Label();


  99:             this.label3 = new System.Windows.Forms.Label();


 100:             ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();


 101:             this.SuspendLayout();


 102:             // 


 103:             // btnPlay


 104:             // 


 105:             this.btnPlay.Location = new System.Drawing.Point(18, 64);


 106:             this.btnPlay.Name = "btnPlay";


 107:             this.btnPlay.Size = new System.Drawing.Size(87, 20);


 108:             this.btnPlay.TabIndex = 0;


 109:             this.btnPlay.Text = "Play Sound";


 110:             this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click);


 111:             // 


 112:             // trackBar1


 113:             // 


 114:             this.trackBar1.Location = new System.Drawing.Point(37, 124);


 115:             this.trackBar1.Maximum = 50000;


 116:             this.trackBar1.Minimum = 1000;


 117:             this.trackBar1.Name = "trackBar1";


 118:             this.trackBar1.Size = new System.Drawing.Size(190, 45);


 119:             this.trackBar1.TabIndex = 1;


 120:             this.trackBar1.Value = 30000;


 121:             this.trackBar1.ValueChanged += new System.EventHandler(this.trackBar1_ValueChanged);


 122:             // 


 123:             // txtFreq


 124:             // 


 125:             this.txtFreq.Enabled = false;


 126:             this.txtFreq.Location = new System.Drawing.Point(43, 185);


 127:             this.txtFreq.Name = "txtFreq";


 128:             this.txtFreq.Size = new System.Drawing.Size(100, 20);


 129:             this.txtFreq.TabIndex = 2;


 130:             // 


 131:             // label1


 132:             // 


 133:             this.label1.AutoSize = true;


 134:             this.label1.Location = new System.Drawing.Point(40, 108);


 135:             this.label1.Name = "label1";


 136:             this.label1.Size = new System.Drawing.Size(100, 13);


 137:             this.label1.TabIndex = 3;


 138:             this.label1.Text = "Frequency Change:";


 139:             // 


 140:             // label2


 141:             // 


 142:             this.label2.AutoSize = true;


 143:             this.label2.Location = new System.Drawing.Point(43, 166);


 144:             this.label2.Name = "label2";


 145:             this.label2.Size = new System.Drawing.Size(97, 13);


 146:             this.label2.TabIndex = 4;


 147:             this.label2.Text = "Current Frequency:";


 148:             // 


 149:             // btnStop


 150:             // 


 151:             this.btnStop.Location = new System.Drawing.Point(111, 61);


 152:             this.btnStop.Name = "btnStop";


 153:             this.btnStop.Size = new System.Drawing.Size(88, 21);


 154:             this.btnStop.TabIndex = 5;


 155:             this.btnStop.Text = "Stop";


 156:             this.btnStop.UseVisualStyleBackColor = true;


 157:             this.btnStop.Click += new System.EventHandler(this.btnStop_Click);


 158:             // 


 159:             // openFileDialog1


 160:             // 


 161:             this.openFileDialog1.FileName = "openFileDialog1";


 162:             this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk);


 163:             // 


 164:             // btnNewFile


 165:             // 


 166:             this.btnNewFile.Location = new System.Drawing.Point(205, 61);


 167:             this.btnNewFile.Name = "btnNewFile";


 168:             this.btnNewFile.Size = new System.Drawing.Size(75, 23);


 169:             this.btnNewFile.TabIndex = 6;


 170:             this.btnNewFile.Text = "Open";


 171:             this.btnNewFile.UseVisualStyleBackColor = true;


 172:             this.btnNewFile.Click += new System.EventHandler(this.btnNewFile_Click);


 173:             // 


 174:             // lblFile


 175:             // 


 176:             this.lblFile.AutoSize = true;


 177:             this.lblFile.Location = new System.Drawing.Point(23, 30);


 178:             this.lblFile.Name = "lblFile";


 179:             this.lblFile.Size = new System.Drawing.Size(148, 13);


 180:             this.lblFile.TabIndex = 7;


 181:             this.lblFile.Text = "C:\\Windows\\Media\\ding.wav";


 182:             // 


 183:             // label3


 184:             // 


 185:             this.label3.AutoSize = true;


 186:             this.label3.Location = new System.Drawing.Point(23, 9);


 187:             this.label3.Name = "label3";


 188:             this.label3.Size = new System.Drawing.Size(63, 13);


 189:             this.label3.TabIndex = 8;


 190:             this.label3.Text = "Current File:";


 191:             // 


 192:             // MainForm


 193:             // 


 194:             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);


 195:             this.ClientSize = new System.Drawing.Size(292, 260);


 196:             this.Controls.Add(this.label3);


 197:             this.Controls.Add(this.lblFile);


 198:             this.Controls.Add(this.btnNewFile);


 199:             this.Controls.Add(this.btnStop);


 200:             this.Controls.Add(this.label2);


 201:             this.Controls.Add(this.label1);


 202:             this.Controls.Add(this.txtFreq);


 203:             this.Controls.Add(this.trackBar1);


 204:             this.Controls.Add(this.btnPlay);


 205:             this.Name = "MainForm";


 206:             this.Text = "Sound Frequency Changer";


 207:             ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();


 208:             this.ResumeLayout(false);


 209:             this.PerformLayout();


 210:  


 211:         }


 212:         #endregion


 213:  


 214:         /// <summary>


 215:         /// The main entry point for the application.


 216:         /// </summary>


 217:         [STAThread]


 218:         static void Main()


 219:         {


 220:             Application.Run(new MainForm());


 221:         }


 222:  


 223:         private void btnPlay_Click(object sender, System.EventArgs e)


 224:         {


 225:             


 226:             sound.Play(0, BufferPlayFlags.Looping);


 227:             btnPlay.Enabled = false;


 228:             btnStop.Enabled = true;


 229:         }


 230:  


 231:         private void trackBar1_ValueChanged(object sender, EventArgs e)


 232:         {


 233:             txtFreq.Text = trackBar1.Value.ToString();


 234:             sound.Frequency = trackBar1.Value;


 235:             btnPlay.Enabled = true;


 236:         }


 237:  


 238:         private void btnNewFile_Click(object sender, EventArgs e)


 239:         {


 240:             openFileDialog1.Filter = "wav files (*.wav)|*.wav|All files (*.*)|*.*";


 241:             openFileDialog1.ShowDialog();


 242:         }


 243:  


 244:         private void openFileDialog1_FileOk(object sender, CancelEventArgs e)


 245:         {


 246:             sound.Stop();


 247:             btnPlay.Enabled = true;


 248:             btnStop.Enabled = false;


 249:             lblFile.Text = openFileDialog1.FileName;


 250:             sound = new SecondaryBuffer(openFileDialog1.FileName, d, applicationDevice);


 251:             sound.Frequency = 0; //The default frequency


 252:  


 253:         }


 254:  


 255:         private void btnStop_Click(object sender, EventArgs e)


 256:         {


 257:             sound.Stop();


 258:             btnStop.Enabled = false;


 259:             btnPlay.Enabled = true;


 260:         }


 261:     }


 262: }


 263:  


 264:  







This will allow me to use a beam or phaser sound to create the appearance of strength applied on a element.